Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

COBOL Programming :: RE: How can we create a flat file in JAVA with COMP-3 VALUES?

$
0
0
Author: Bill Woodger
Subject: Reply to: How can we create a flat file in JAVA with COMP-3 VALUES?
Posted: Sat Sep 24, 2016 1:59 am (GMT 5.5)

It is an absurd task which requires substantial coding/processing and all for no possible reason at all.

Yes, people do it, but more fool them. Also ask the audit/compliance/accounting departments. Tell them that instead of just using "print" statements to format your numeric data and allow the built-in ASCII-EBCDIC conversion of your transport mechanism, you want to do all of the conversions yourself, including accurately representing packed-decimal data, and the entire benefit is... nothing. To the detriment is a bag of code you know little about, which you have to cobble together from potentially ropey libraries (I'll bet not a single library actually knows all about packed-decimal data).

I'll show you the code on the Mainframe if you do all that work to provide the data in EBCDIC with packed-decimal numerics:

Code:
MOVE my-input-numeric TO destination-numeric


Now the code if you don't do all the stupid stuff, and just provide the data as fixed-width "character" data (leading zeros, actual decimal-point, actual sign (leading or trailing, whichever is easier).

Code:
MOVE my-input-numeric TO destination-numeric


Hey, you mean it makes absolutely no difference on the Mainframe, whatever I code? Yeah, pretty much. The only thing that needs to be different is the definition of your field. Funny that someone wants you to do shed-loads of work on something you know nothing about for absolutely no point, isn't it?


Viewing all articles
Browse latest Browse all 8500

Trending Articles