As per my requirment, I need to reformat the above report data into an input file which has all the above 3 columns. the COLUMN2 data needs to be converted to binary format and COLUMN3 data needs to be converted to packed decimal format.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Here's a DFSORT job that will do what you asked for. You didn't give the starting positions and lengths for the output fields, so I just made some assumptions. You can change the job as needed.
thank you Frank Yaeger. It is working to some extent. I may have to modify to some extent to match my requirement exactly. Can you please explain that sort card?
As per the sort card given by you, the -ve sign on some values is not appearing after conversion.
Hey Frank, can you give the exact sort criterion. Below is other info which you asked for....
the column2 declaration in cobol is as ZZZ,ZZZ,ZZ9-.
the cloumn3 declaration in cobol is as ZZZ,ZZZ,ZZ9.99-.
the output column positions are in sequence without any spaces between them.
1,12 - just copies input positions 1-12 to output positions 1-12.
13,7,UFF,TO=BI,LENGTH=4 - treats input positions 13-19 as an unsigned free form value and converts it to a 4-byte BI output value.
29,14,SFF,TO=PD,LENGTH=8 - treats positions 29-42 as a signed free form value and converts it to an 8-byte PD value.
Quote:
As per the sort card given by you, the -ve sign on some values is not appearing after conversion.
On which field? You said you wanted binary for the second column - binary is unsigned. But now you're describing the second column as having a sign. So you'd want to use SFF (signed free form) instead of UFF (unsigned free form) and you'd probably want to convert to FI (signed) rather than BI (unsigned).
You didn't give the starting positions or lengths of the fields, so I guessed. From your new descriptions, it appears the fields are longer than I guessed, so adjust accordingly.
If you can't work it out yourself, tell me the starting position of the column2 and column3 fields and what you want for the lengths of the FI and PD output fields.