View previous topic :: View next topic
Author
Message
prav_06 Warnings : 1 Active User Joined: 13 Dec 2005Posts: 154 Location: The Netherlands
Dear All,
I have a requirement , there is a flat file in which I have records as given below
Code:
1FPY 01A00CP1FILE1
2CORRECT.......
2ERROR.........
2WARNING.......
1FPY 01A00CP1FILE2
2CORRECT.......
2ERROR.........
2WARNING.......
1FPY 01A00CP1FILE3
2CORRECT.......
2ERROR.........
2WARNING.......
1FPY 01A00CP1FILE4
2CORRECT.......
2ERROR.........
2WARNING.......
1FPY 01A00CP1FILE5
2CORRECT.......
2ERROR.........
2WARNING.......
My reqiurement is to split these recrods as given below
Code:
1FPY 01A00CP1FILE1
2CORRECT.......
2ERROR.........
2WARNING.......
Code:
1FPY 01A00CP1FILE2
2CORRECT.......
2ERROR.........
2WARNING.......
Code:
1FPY 01A00CP1FILE3
2CORRECT.......
2ERROR.........
2WARNING.......
Code:
1FPY 01A00CP1FILE4
2CORRECT.......
2ERROR.........
2WARNING.......
1FPY 01A00CP1FILE5
2CORRECT.......
2ERROR.........
2WARNING.......
Code:
There can be maximum of 5 set of such records which are to be copied to 5 diff files. If it is only 3 set of records then it has to move to 3 different files.
Can this be done by Sort or COPY or ICETOOL, please let me know ASAP
Back to top
dbzTHEdinosauer Global Moderator Joined: 20 Oct 2006Posts: 6966 Location: porcelain throne
Quote:
Can this be done by Sort or COPY or ICETOOL, please let me know ASAP
I hope this answer is quick enough for you----yes it can be done with DFSORT; SYNCSORT also.
Back to top
expat Global Moderator Joined: 14 Mar 2007Posts: 8797 Location: Welsh Wales
Which sort product is installed at your site ? By posting in the JCL forum we can only assume that it is SYNCSORT.
Back to top
prav_06 Warnings : 1 Active User Joined: 13 Dec 2005Posts: 154 Location: The Netherlands
could you please provide me the JCLS.
Back to top
expat Global Moderator Joined: 14 Mar 2007Posts: 8797 Location: Welsh Wales
The solution depends on the product that is installed at your site.
Unless you bother to tell us, how will we know.
Back to top
prav_06 Warnings : 1 Active User Joined: 13 Dec 2005Posts: 154 Location: The Netherlands
hello,
We have both DFSORT & SYNCSORT
Back to top
Frank Yaeger DFSORT Developer Joined: 15 Feb 2005Posts: 7129 Location: San Jose, CA
You can use a DFSORT job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.
Code:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/80)
//OUT1 DD DSN=... output file1 (FB/80)
//OUT2 DD DSN=... output file2 (FB/80)
//OUT3 DD DSN=... output file3 (FB/80)
//OUT4 DD DSN=... output file4 (FB/80)
//OUT5 DD DSN=... output file5 (FB/80)
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,1,CH,EQ,C'1'),PUSH=(81:ID=1))
OUTFIL FNAMES=OUT1,INCLUDE=(81,1,CH,EQ,C'1'),BUILD=(1,80)
OUTFIL FNAMES=OUT2,INCLUDE=(81,1,CH,EQ,C'2'),BUILD=(1,80)
OUTFIL FNAMES=OUT3,INCLUDE=(81,1,CH,EQ,C'3'),BUILD=(1,80)
OUTFIL FNAMES=OUT4,INCLUDE=(81,1,CH,EQ,C'4'),BUILD=(1,80)
OUTFIL FNAMES=OUT5,INCLUDE=(81,1,CH,EQ,C'5'),BUILD=(1,80)
/*
Back to top
Please enable JavaScript!