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
 

 

Syncsort How to split the file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Syncsort How to split the file
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    Post subject:
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    Post subject: Reply to: Syncsort How to split the file
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm


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