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 Usergroups Profile Log in to check your private messages Log in
 

 

Split One file into 10 files based on Dynamic control card

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

New User


Joined: 16 Aug 2011
Posts: 7
Location: USA

PostPosted: Tue Aug 16, 2011 4:22 am    Post subject: Split One file into 10 files based on Dynamic control card
Reply with quote

Hi,
I need to split my INPUT file (say FILE1) into 10 different files (FILE2, FILE3.. FILE10) based on the KEY (of 9 characters) , which comes as an input at 1st position of every record. This KEY is dynamic.

eg:-
INPUT:- FILE1 of LRECL 500 & RECFM=FB & below is the sample data format...

111111111Alhgdlhgldhldhgdhlh9
111111111Blhgdlhgldhldhgdhlh9
222222222Adlghdlghdhgdlghd00
222222222Bdlghdlghdhgdlghd00
333333333Bbbklbdkbddhldhdl99
333333333Cbbklbdkbddhldhdl99
444444444Ddhdlhepueup-22ww
444444444Edhdlhepueup-22ww
........
.........
999999999Gbbbbljjs[wjjsjfsjfa
101010101Abbbbbljjs[wjjsjfsjfa
101010101Bbbbbbljjs[wjjsjfsjfa

OUT PUT:- I need to have 10 different files of same RECFM= FB, LRECL= 500.

FILE2:
111111111Alhgdlhgldhldhgdhlh9
111111111Blhgdlhgldhldhgdhlh9

FILE3:
222222222Adlghdlghdhgdlghd00
222222222Bdlghdlghdhgdlghd00

FILE4:
333333333Bbbklbdkbddhldhdl99
333333333Cbbklbdkbddhldhdl99

FILE5:
444444444Ddhdlhepueup-22ww
444444444Edhdlhepueup-22ww

FILE6:
.....
......

FILE9:
999999999Gbbbbljjs[wjjsjfsjfa
FILE10:
101010101Abbbbbljjs[wjjsjfsjfa
101010101Bbbbbbljjs[wjjsjfsjfa

NOTEs:

1) Input file is in SORTED order of the KEY (Position 1-9)
2) The KEY is Dynamic, it can be of any value in the input file based on the input data.
3) The max. no.of. UNIQUE Values in this key filed will be of 10.
4) Always the total no.of. OUTPUT files needs to be '10', of fixed DD DSN names.
5) Even if there are only 1 UNIQUE key in the input file, all the records in the input file should goto FILE2 & the remaining 9 output files needs to be created as EMPTY files.

I wanted to get this done using DFSORT/ICETOOL.. I couldn't find any similar post that gives me the results that I'm looking for... can some one help me with this pls... ?

The sample control card that I'm looking for is mentioned below, OR, it can be some other format that gives me desired result...
SYSIN DD * (or it can be in a file)
OPTION COPY
OUTFIL FILES=1,INCLUDE=(01,09,CH,EQ,C'111111111')
OUTFIL FILES=2,INCLUDE=(01,09,CH,EQ,C'222222222')
OUTFIL FILES=3,INCLUDE=(01,09,CH,EQ,C'333333333')
......
......
OUTFIL FILES=9,INCLUDE=(01,09,CH,EQ,C'999999999')
OUTFIL FILES=10,INCLUDE=(01,09,CH,EQ,C'1010101010')
/*

Thanks,
Gowtham
Back to top
View user's profile Send private message

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Aug 16, 2011 4:45 am    Post subject: Reply to: Split One file into 10 files based on Dynamic cont
Reply with quote

GOWTHAM PAINENI,


use the following DFSORT JCL which will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT 
//SYSOUT   DD SYSOUT=*   
//SORTIN   DD DSN=Your input file Fb 500 byte file,DISP=SHR
//OUT01    DD SYSOUT=*                                         
//OUT02    DD SYSOUT=*                                         
//OUT03    DD SYSOUT=*                                         
//OUT04    DD SYSOUT=*                                         
//OUT05    DD SYSOUT=*                                         
//OUT06    DD SYSOUT=*                                         
//OUT07    DD SYSOUT=*                                         
//OUT08    DD SYSOUT=*                                         
//OUT09    DD SYSOUT=*                                         
//OUT10    DD SYSOUT=*                                         
//SYSIN    DD *                                               
  SORT FIELDS=COPY                                             
  OUTREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,9),PUSH=(501:ID=2))   
  OUTFIL FNAMES=OUT01,BUILD=(1,500),INCLUDE=(501,2,ZD,EQ,01)   
  OUTFIL FNAMES=OUT02,BUILD=(1,500),INCLUDE=(501,2,ZD,EQ,02)   
  OUTFIL FNAMES=OUT03,BUILD=(1,500),INCLUDE=(501,2,ZD,EQ,03)   
  OUTFIL FNAMES=OUT04,BUILD=(1,500),INCLUDE=(501,2,ZD,EQ,04)   
  OUTFIL FNAMES=OUT05,BUILD=(1,500),INCLUDE=(501,2,ZD,EQ,05)   
  OUTFIL FNAMES=OUT06,BUILD=(1,500),INCLUDE=(501,2,ZD,EQ,06)   
  OUTFIL FNAMES=OUT07,BUILD=(1,500),INCLUDE=(501,2,ZD,EQ,07)   
  OUTFIL FNAMES=OUT08,BUILD=(1,500),INCLUDE=(501,2,ZD,EQ,08)   
  OUTFIL FNAMES=OUT09,BUILD=(1,500),INCLUDE=(501,2,ZD,EQ,09)   
  OUTFIL FNAMES=OUT10,BUILD=(1,500),INCLUDE=(501,2,ZD,EQ,10)   
//*
Back to top
View user's profile Send private message
GOWTHAM PAINENI

New User


Joined: 16 Aug 2011
Posts: 7
Location: USA

PostPosted: Tue Aug 16, 2011 5:39 am    Post subject: Reply to: Split One file into 10 files based on Dynamic cont
Reply with quote

Thank you Kolusu !! The above JCL giving me exactly what I need, Thank you !!
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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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