View previous topic :: View next topic
|
Author |
Message |
aedesy
New User
Joined: 11 Feb 2022 Posts: 6 Location: ITALY
|
|
|
|
Hi all,
I have some issues to sort a CSV as input file. This file has LRECL=290 and RECFM=VB.
Here is a little pic about the records:
189660;PF;3;65916;12/07/2016;...continues
371898;PF;20;64883;27/01/2017;...
5928375;PF;10;77093;17/10/2016;...
5183087;PF;104;65337;12/06/2015;...
Now I'd like to have the following output:
0189660;PF;003;65916;12/07/2016;...
0371898;PF;020;64883;27/01/2017;...
5928375;PF;010;77093;17/10/2016;...
5183087;PF;104;65337;12/06/2015;...
I tried to use PGM=SORT and the following sort card in my JCL:
SORT FIELDS=COPY
INREC PARSE=(%00=(ENDBEFR=C';',FIXLEN=7),
%01=(ENDBEFR=C';',FIXLEN=2),
%02=(ENDBEFR=C';',FIXLEN=3)),
BUILD=(%00,%01,%02)
OUTREC BUILD=(1,7,SQZ=(SHIFT=RIGHT),C';',9,2,C';',12,3,
SQZ=(SHIFT=RIGHT),C';',16,274)
But I it gave me a RC=16. Could be a syntax error? Any suggestions? Thanks in adavance. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1255 Location: Bamberg, Germany
|
|
|
|
Please use Code Tags for Code and Data. There is a Button named Code that works as a toggle exactly for this purpose.
Your OUTREC is buggy. Consider using UFF,M11 to format. Send Msgs that you have received in the Job. |
|
Back to top |
|
|
aedesy
New User
Joined: 11 Feb 2022 Posts: 6 Location: ITALY
|
|
|
|
Hi, thanks for your answer. I tried many times and finally I figured that out. This code works perfectly for me:
Code: |
INREC PARSE=(%00=(ENDBEFR=C';',FIXLEN=9),
%01=(ENDBEFR=C';',FIXLEN=2),
%02=(ENDBEFR=C';',FIXLEN=3),
%03=(SUBPOS=1,FIXLEN=272)),
BUILD=(1,4,%00,UFF,M11,LENGTH=9,C';',%01,C';',
%02,UFF,M11,LENGTH=3,%03)
SORT FIELDS=(15,2,CH,A,19,3,CH,A,21,5,CH,A),SKIPREC=1 |
|
|
Back to top |
|
|
|
|