Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
It's not clear what you're trying to do. Please don't expect us to to jump into the middle of the job you created and figure out what you want. We can't read your mind.
Start from the beginning. How are we supposed to interpret gibberish like Ññ%.. in your example records - show PD fields in hexadecimal or decimal. Explain the "rules" in detail for getting from input to output. Give the RECFM and LRECL of the input file. Give the starting position, length and format of each relevant field.
Hi,
My input file is :
YEC8505 5200812012150,00
YEC8505 5200812161450,00
YEC8505 5200812172550,00
YEC8505 8200812172850,00
YEC8505 F200812175950,00
Lrecl 23 Recm fB
The key is on 1,17 she is unique
On 9,1 it is type code of the record
On 11,7 it is the date of the record (YYYYMMDD)
On 18,4 it is packed decimal
When the type code on 9,1 is '5' and the day of the date is not 01 on 16,2
i write 'VM02 ' on 1;
the date on 10;
the packed decimal on 17 but it must be expand
xxxx,xx to xxxx,xxxxx
N on 23.
When the type code on 9,1 is 'F'
i write 'VM10 ' on 1;
the date on 10;
the packed decimal on 17 but it must be expand
xxxx,xx to xxxx,xxxxx
N on 23.
In other cases i omit the records
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Considering you said "I have no duplicate key on 1,17" why are you using SELECT with NODUPS? If you don't have any duplicates, then the SELECT will just give you a sorted version of the input file. So you could just use SORT instead of SELECT. What am I missing here?
Also, you said the date field is 11,7 but it appears to be 10,8.
At any rate, here's a better DFSORT/ICETOOL job that will give you the same output as your job.