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

Syncsort How to split the file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nareshdacha

New User


Joined: 12 Jan 2010
Posts: 66
Location: US

PostPosted: Thu Sep 23, 2010 11:26 am
Reply with quote

I have an input file(which have reports) like below:

1REPORT ID: EXP-100
REPORTING FOR: XXX
........................
DATA
............................

1REPORT ID: EXP-101
REPORTING FOR: XXX
..........................
DATA
.....................
1REPORT ID: EXP-103
REPORTING FOR: XXX
....................
DATA
..............
1REPORT ID: EXP-104
REPORTING FOR: XXX

I want to split the above input file into different files. File1 should contain the EXP-100 report details, file2 should contain EXP-101 details, file3 should contain EXP-102 report details and file4 should contain EXP-104 report details.


Please suggest......
Back to top
View user's profile Send private message
smijoss

Active User


Joined: 30 Aug 2007
Posts: 114
Location: pune

PostPosted: Thu Sep 23, 2010 12:29 pm
Reply with quote

LRECL RECFM ??

are the records per ID constant ??

you have only 4 ids in the file ??

read "Smart DFSORT Tricks" , it has different ways to split a file , check if your requirement can be solved using them .

if not you can alwasys use IFTHEN -WHEN=GROUP
and then use OUTFIL FNAMES to split
Back to top
View user's profile Send private message
nareshdacha

New User


Joined: 12 Jan 2010
Posts: 66
Location: US

PostPosted: Thu Sep 23, 2010 3:30 pm
Reply with quote

Thanks for the suggestion....

LRECL = 133
RECFM = FB

Actual input file has 17 reports. I just gave the sample data.
I have searched in "Smart DFSORT Tricks" but those doesn't suite my requirement...
Back to top
View user's profile Send private message
nil_mf

New User


Joined: 06 Jun 2005
Posts: 29

PostPosted: Thu Sep 23, 2010 5:08 pm
Reply with quote

Hi,

You can try the below sortcard

INREC IFTHEN=(WHEN=INIT,OVERLAY=(134:SEQNUM,8,ZD)),
IFTHEN=(WHEN=(13,3,CH,EQ,C'EXP'),OVERLAY=(142:SEQNUM,8,ZD)),
IFTHEN=(WHEN=NONE,
OVERLAY=(150:SEQNUM,8,ZD,142:134,8,ZD,SUB,150,8,ZD,M11,LENGTH=8))
SORT FIELDS=COPY
OUTFIL FNAMES=OUT1,INCLUDE=(142,8,ZD,EQ,1),BUILD=(1,133)
OUTFIL FNAMES=OUT2,INCLUDE=(142,8,ZD,EQ,2),BUILD=(1,133)
OUTFIL FNAMES=OUT3,INCLUDE=(142,8,ZD,EQ,3),BUILD=(1,133)
OUTFIL FNAMES=OUT4,SAVE,BUILD=(1,133)



regards
nil
Back to top
View user's profile Send private message
prahalad

New User


Joined: 14 Sep 2010
Posts: 18
Location: Pune

PostPosted: Thu Sep 23, 2010 5:54 pm
Reply with quote

Can you try with the following code. I have done for 4 output file you can repeat the OUTFIL condition for the desired number of files. Please let me know if any other details required.

Code:

 INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,11,CH,EQ,C'1REPORT ID:'),
                          PUSH=(151:17,3))                 
 OPTION EQUALS                                             
 SORT FIELDS=(151,03,CH,A)                                 
 OUTFIL FNAMES=OUT1,INCLUDE=(151,3,ZD,EQ,101),BUILD=(1,133)
 OUTFIL FNAMES=OUT2,INCLUDE=(151,3,ZD,EQ,102),BUILD=(1,133)
 OUTFIL FNAMES=OUT3,INCLUDE=(151,3,ZD,EQ,103),BUILD=(1,133)
 OUTFIL FNAMES=OUT4,INCLUDE=(151,3,ZD,EQ,104),BUILD=(1,133) 
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
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
Search our Forums:

Back to Top