Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
thirunarayanan

New User

Joined: 06 Oct 2006
Posts: 9

 Posted: Wed Oct 11, 2006 6:46 pm    Post subject: JCL to Split a file to 10 files based on 7th digit of key Hi All Can anyone provide me a logic using DFSORT to split a file into 10 parts based on the 7th digit of the key. My input file has data XXXXXX1XXXXX..... XXXXXX2XXXXX..... XXXXXX9XXXXX..... XXXXXX&XXXXX..... XXXXXX\$XXXXX..... XXXXXXAXXXXX..... XXXXXXCXXXXX..... XXXXXXDXXXXX..... XXXXXXGXXXXX..... XXXXXXEXXXXX..... XXXXXXZ1XXXXX..... XXXXXXWXXXXX..... the 7th digit can be any Alphanumeric value.(including special char) My 10 split files should contain values like this split0-(7th digit is either '0' , 'A' , 'B' , 'C' ) split1-(7th digit is either '1' , 'D' , 'E' , 'F' ) split2-(7th digit is either '0' , 'G' , 'H' , 'I' ) split3-(7th digit is either '1' , 'J' , 'K' , 'L' ) split4-(7th digit is either '0' , 'M' , 'N' , 'O' ) split5-(7th digit is either '1' , 'P' , 'Q' , 'R' ) split6-(7th digit is either '0' , 'S' , 'T' ) split7-(7th digit is either '1' , 'U' , 'V' , ) split8-(7th digit is either '0' , 'W' , 'X' ) split9-(7th digit is either '1' , 'Y' , 'Z' , and ANYOTHER special char) I want to know if this logic can be implemented in JCL within a single sortstep. ? Please let me know the answer. Thanx Regards Thiru

thirunarayanan

New User

Joined: 06 Oct 2006
Posts: 9

 Posted: Wed Oct 11, 2006 6:50 pm    Post subject: pardon me!!! I made a mistake explaning the logic. Please find below the question Hi All Can anyone provide me a logic using DFSORT to split a file into 10 parts based on the 7th digit of the key. My input file has data XXXXXX1XXXXX..... XXXXXX2XXXXX..... XXXXXX9XXXXX..... XXXXXX&XXXXX..... XXXXXX\$XXXXX..... XXXXXXAXXXXX..... XXXXXXCXXXXX..... XXXXXXDXXXXX..... XXXXXXGXXXXX..... XXXXXXEXXXXX..... XXXXXXZ1XXXXX..... XXXXXXWXXXXX..... the 7th digit can be any Alphanumeric value.(including special char) My 10 split files should contain values like this split0-(7th digit is either '0' , 'A' , 'B' , 'C' ) split1-(7th digit is either '1' , 'D' , 'E' , 'F' ) split2-(7th digit is either '2' , 'G' , 'H' , 'I' ) split3-(7th digit is either '3' , 'J' , 'K' , 'L' ) split4-(7th digit is either '4' , 'M' , 'N' , 'O' ) split5-(7th digit is either '5' , 'P' , 'Q' , 'R' ) split6-(7th digit is either '6' , 'S' , 'T' ) split7-(7th digit is either '7' , 'U' , 'V' , ) split8-(7th digit is either '8' , 'W' , 'X' ) split9-(7th digit is either '9' , 'Y' , 'Z' , and ANYOTHER special char) I want to know if this logic can be implemented in JCL within a single sortstep. ? Please let me know the answer. Thanx Regards Thiru
Frank Yaeger

DFSORT Moderator

Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

Posted: Wed Oct 11, 2006 8:34 pm    Post subject:

Here's a DFSORT job that will do what you asked for:

 Code: //S1    EXEC  PGM=ICEMAN //SYSOUT    DD  SYSOUT=* //SORTIN DD DSN=...  input file //OUT0 DD DSN=...  output file0 //OUT1 DD DSN=...  output file1 //OUT2 DD DSN=...  output file2 //OUT3 DD DSN=...  output file3 //OUT4 DD DSN=...  output file4 //OUT5 DD DSN=...  output file5 //OUT6 DD DSN=...  output file6 //OUT7 DD DSN=...  output file7 //OUT8 DD DSN=...  output file8 //OUT9 DD DSN=...  output file9 //SYSIN    DD    *   OPTION COPY   OUTFIL FNAMES=OUT0,INCLUDE=(7,1,SS,EQ,C'0ABC')   OUTFIL FNAMES=OUT1,INCLUDE=(7,1,SS,EQ,C'1DEF')   OUTFIL FNAMES=OUT2,INCLUDE=(7,1,SS,EQ,C'2GHI')   OUTFIL FNAMES=OUT3,INCLUDE=(7,1,SS,EQ,C'3JKL')   OUTFIL FNAMES=OUT4,INCLUDE=(7,1,SS,EQ,C'4MNO')   OUTFIL FNAMES=OUT5,INCLUDE=(7,1,SS,EQ,C'5PQR')   OUTFIL FNAMES=OUT6,INCLUDE=(7,1,SS,EQ,C'6ST')   OUTFIL FNAMES=OUT7,INCLUDE=(7,1,SS,EQ,C'7UV')   OUTFIL FNAMES=OUT8,INCLUDE=(7,1,SS,EQ,C'8WX')   OUTFIL FNAMES=OUT9,SAVE /*
thirunarayanan

New User

Joined: 06 Oct 2006
Posts: 9

 Posted: Thu Oct 12, 2006 11:48 am    Post subject: Thanks frank.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics B059 PREMATURE END OF FILE mvmadhuvenkatesh CA Products 4 Tue Jun 19, 2018 10:50 am Formating output file Niki DFSORT/ICETOOL 3 Fri Jun 15, 2018 3:27 pm Need help on TDQ load from file using... subratarec CICS 4 Wed Jun 13, 2018 11:32 pm How to Count a particular record in a... Mounika Nemani DFSORT/ICETOOL 5 Tue May 29, 2018 1:07 pm BAMAD file IO Error m1985nehal CICS 1 Fri May 25, 2018 11:51 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us