Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
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
 
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 COB2 file processing rizwanaccy COBOL Programming 8 Tue Jan 02, 2018 1:00 pm
No new posts KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
No new posts Preserve order in Input File pshongal DFSORT/ICETOOL 13 Thu Dec 21, 2017 4:20 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us