Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
JCL to Split a file to 10 files based on 7th digit of key

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
thirunarayanan

New User


Joined: 06 Oct 2006
Posts: 9

PostPosted: Wed Oct 11, 2006 6:46 pm    Post subject: JCL to Split a file to 10 files based on 7th digit of key
Reply with quote

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
Back to top
View user's profile Send private message

thirunarayanan

New User


Joined: 06 Oct 2006
Posts: 9

PostPosted: Wed Oct 11, 2006 6:50 pm    Post subject:
Reply with quote

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
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Wed Oct 11, 2006 8:34 pm    Post subject:
Reply with quote

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
/*
Back to top
View user's profile Send private message
thirunarayanan

New User


Joined: 06 Oct 2006
Posts: 9

PostPosted: Thu Oct 12, 2006 11:48 am    Post subject:
Reply with quote

Thanks frank.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts Mainframe dataset split purushottam DFSORT/ICETOOL 13 Tue Aug 29, 2017 12:28 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm

Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us