View previous topic :: View next topic
Author
Message
viveksurya New User Joined: 08 Jun 2009Posts: 36 Location: Bangalore
Though I fetched many threads but could not find a solution
Input File has:
Header - 1st column = 0
Detail recs - 1st col = 1
Trailer - 1st column = 9
Code:
000100 0021720101326
000200 1A458746987456JKDJSJD7845T
000300 1A3464587486HJDSFHJKFDGKHFDKK
000400 1B3647845JKDGHJDFGHJDFGHJDFGHJ
000500 1B3545433IEIEIJJHJHJDFGHJDFGHJ
000600 1AJSDGSDKFKJ95794679KJDGJKDSFGJK
000700 9 502172010
I need to have to output files.
Out file 1:
1) Should have header record as it is in Input file
2) Should have records with 1st col = 1 & 2nd column = 'A'
3) Trailer having count of records (Count should exclude header & trailer)
So it shud look like:
Code:
000100 0021720101326
000200 1A458746987456JKDJSJD7845T
000300 1A3464587486HJDSFHJKFDGKHFDKK
000400 1AJSDGSDKFKJ95794679KJDGJKDSFGJK
000500 000000003
Out file 2:
Out file 1:
1) Should have header record as it is in Input file
2) Should have records with 1st col = 1 & 2nd column = 'B'
3) Trailer having count of records (Count should exclude header & trailer)
I tried with the following Sort Card:
Code:
OPTION COPY
OUTFIL FNAMES=FILE1,INCLUDE=(1,1,CH,EQ,C'0',OR,1,1,CH,EQ,C'1',
AND,2,1,CH,EQ,C'A'),REMOVECC,TRAILER1=(COUNT-1=(M11,LENGTH=9))
OUTFIL FNAMES=FILE2,INCLUDE=(1,1,CH,EQ,C'0',OR,1,1,CH,EQ,C'1',
AND,2,1,CH,EQ,C'B'),REMOVECC,TRAILER1=(COUNT-1=(M11,LENGTH=9))
But this is giving syntax error:
Code:
WER268A OUTFIL STATEMENT : SYNTAX ERROR
WER268A OUTFIL STATEMENT : SYNTAX ERROR
PS: I am using SYNCSORT
ANy help would be much appreciated.
Thanks and regards,
Vivek
Back to top
Alissa Margulies SYNCSORT Support Joined: 25 Jul 2007Posts: 496 Location: USA
Hello Vivek.
Here are the SyncSort for z/OS control statements that should give you the requested output:
Code:
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(1,1,CH,EQ,C'0',OR,1,2,CH,EQ,C'1A'),
REMOVECC,TRAILER1=(COUNT-1=(EDIT=(TTTTTTTTT)))
OUTFIL FILES=02,INCLUDE=(1,1,CH,EQ,C'0',OR,1,2,CH,EQ,C'1B'),
REMOVECC,TRAILER1=(COUNT-1=(EDIT=(TTTTTTTTT)))
/*
Back to top
viveksurya New User Joined: 08 Jun 2009Posts: 36 Location: Bangalore
Many thanks Alissa. It is working fine.
Just an additional query.
How can we have count in the Trailer written in Packed-Decimal format..??
I tried :
Code:
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(1,1,CH,EQ,C'0',OR,1,2,CH,EQ,C'1A'),
REMOVECC,TRAILER1=(COUNT-1=PD)
OUTFIL FILES=02,INCLUDE=(1,1,CH,EQ,C'0',OR,1,2,CH,EQ,C'1B'),
REMOVECC,TRAILER1=(COUNT-1=PD)
But this is giving syntax error.
Thanks and regards,
Vivek
Back to top
Alissa Margulies SYNCSORT Support Joined: 25 Jul 2007Posts: 496 Location: USA
Hello Vivek.
To convert the COUNT field to PD format, you must specify the length subparameter. Try the following:
Code:
TRAILER1=(COUNT-1=(PD,LENGTH=5))
Back to top
Please enable JavaScript!