IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

JCL to Split a file to 10 files based on 7th digit of key


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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 Developer


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

PostPosted: Wed Oct 11, 2006 8:34 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top