Need to copy the output file to another sequential file (all the records) and convert to Zoned Decimal from these 4 Fixed Decimal as well.
I know that I have to use OUTREC FIELDS with PD,TO=ZD but when I mentioning this with column details (like for the first fixed dec 13,3) it is copying only those columns but I want to copy all the recs with converted data
Joined: 22 Dec 2007 Posts: 116 Location: Bangalore
I used below code and got my job done. This code may not be the best but for time being it serves my need. But if you have any suggestion please let me have that so I can do better in future. Thanks Bill!!
Joined: 09 Mar 2011 Posts: 7311 Location: Inside the Matrix
It is a curious coincidence if you need to truncate all of the packed-decimal values. A 3-byte PD can contain five digits: you use length of three.
If you do need to change that, you're going to have a small problem because the LIKE in the JCL is going to give you an LRECL, whereas the record you create will be longer than the record it came from.
It is always better, with SORT, not to specify the LRECL in the JCL for the output file, as you will then have two places to change it (the SORT cards and the JCL) rather than just let SORT supply it (which it will do if not specified).
You can always make life easier for yourself (and others) by making it easier to read and change: