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

Split Files after a particular record


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

New User


Joined: 24 Aug 2007
Posts: 38
Location: chennai

PostPosted: Wed Aug 29, 2012 12:16 am
Reply with quote

Hi,

I have a requirement to split file after identifying a particular record in the Input.

To explain in detail.

Input file :

SUMMREPT AAAAAAA
BBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCC
DDDDDDDDDDDDDDD
EEEEEEEEEEEEEEEEE
SUMMREPT FFFFFFFFF
GGGGGGGGGGGGGGG
BBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCC
SUMMREPT CCCCCCC
AAAAAAAAAAAAAAAAA

This need to be split into 3 files whenever the character 'SUMMREPT' is identified in column 1 - 8.


Output file 1 :

SUMMREPT AAAAAAA
BBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCC
DDDDDDDDDDDDDDD
EEEEEEEEEEEEEEEEE

Output file 2 :

SUMMREPT FFFFFFFFF
GGGGGGGGGGGGGGG
BBBBBBBBBBBBBBBBB
CCCCCCCCCCCCCCC

Output file 3 :

SUMMREPT CCCCCCC
AAAAAAAAAAAAAAAAA

.

Any help to have this done through SORT cards is highly appreciated. Thanks !
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Aug 29, 2012 12:22 am
Reply with quote

You did not mention it but I presume SYNCSORT?
Back to top
View user's profile Send private message
sanil m

New User


Joined: 24 Aug 2007
Posts: 38
Location: chennai

PostPosted: Wed Aug 29, 2012 12:25 am
Reply with quote

Hello Nic,

Yes, Using Sort Utilities.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Aug 29, 2012 12:38 am
Reply with quote

Quote:
Yes, Using Sort Utilities.

pretty useless reply.... icon_evil.gif

we wantto know if You are using
SYNCSORT ==> WER... messages
DFSORT ==> ICE... messages

in any case post the output of

Code:
 ****** ***************************** Top of Data ******************************
 000001 //<appropriate jobcard>
 000002 //*
 000003 //*
 000004 //S       EXEC PGM=SORT
 000005 //SYSOUT    DD SYSOUT=*
 000006 //SORTIN    DD *
 000007 DUMMY
 000008 //SORTOUT   DD SYSOUT=*,
 000009 //             DCB=(RECFM=FB,LRECL=80)
 000010 //SYSIN     DD *
 000011   OPTION COPY
 ****** **************************** Bottom of Data ****************************


so we can see the level of the sort product You are using
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Aug 29, 2012 12:44 am
Reply with quote

anyway the issue has been debated to death...
since You lazily did not care to search the forum
I am going to save some of Your precious time posting some control cards
from which using Your neurons You will be able to deduce the right solutiopn for Your need

Code:
 OPTION COPY                                                             
 INREC  IFTHEN=(WHEN=GROUP,BEGIN=(1,8,CH,EQ,C'SUMREPT'),             
        PUSH=(81:ID=2))  <== works for 99 groups
 OUTFIL FNAMES=OUT01,INCLUDE=(81,2,CH,EQ,C'01') BUILD=(1,80)   
 OUTFIL FNAMES=OUT02,INCLUDE=(81,2,CH,EQ,C'02') BUILD=(1,80)   
 ...
 OUTFIL FNAMES=OUT99,INCLUDE=(81,2,CH,EQ,C'99') BUILD=(1,80)   
Back to top
View user's profile Send private message
sanil m

New User


Joined: 24 Aug 2007
Posts: 38
Location: chennai

PostPosted: Wed Aug 29, 2012 12:52 am
Reply with quote

@ Enrico,

Using SYNCSORT.

From the step which you've asked to execute.

I hope the below information is ok.

SYNCSORT FOR Z/OS 1.4.0.1R
C) 2010 SYNCSORT INC.

Let me know if i'm missing something. Thanks !
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Aug 29, 2012 12:54 am
Reply with quote

the snippet I posted was tested for dfsort, should work also for syncsort.
Back to top
View user's profile Send private message
sanil m

New User


Joined: 24 Aug 2007
Posts: 38
Location: chennai

PostPosted: Wed Aug 29, 2012 3:47 am
Reply with quote

@ Enrico.

Thanks a lot. This worked correctly.


P.S : I did some search before posting here. I wasn't aware of the GROUP keyword. But anyway thanks for replying to me with patience.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Aug 29, 2012 6:10 am
Reply with quote

If you go with three OUTFILs, what happens if you get a fourth SUMMREPT?

If this can happen and you want it in the third output dataset, then you can code SAVE for the third OUTFIL.

If this may happen and you want it in a fourth dataset, then code a fourth OUTFIL with SAVE.

In DFSORT, anyway :-)

If it happens, another one appearing, with three plain OUTFIL INCLUDE then you may just loose the data or find it on SORTOUT if specified.
Back to top
View user's profile Send private message
sanil m

New User


Joined: 24 Aug 2007
Posts: 38
Location: chennai

PostPosted: Wed Aug 29, 2012 11:09 pm
Reply with quote

Thanks Bill for the Information.
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 How to split large record length file... DFSORT/ICETOOL 7
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
Search our Forums:

Back to Top