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 Files after a particular record

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Split Files after a particular record
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: 1715
Location: UK

PostPosted: Wed Aug 29, 2012 12:22 am    Post subject:
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    Post subject: Reply to: Split Files after a particular record
Reply with quote

Hello Nic,

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Wed Aug 29, 2012 12:38 am    Post subject: Reply to: Split Files after a particular record
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Wed Aug 29, 2012 12:44 am    Post subject: Reply to: Split Files after a particular record
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    Post subject: Reply to: Split Files after a particular record
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Wed Aug 29, 2012 12:54 am    Post subject: Reply to: Split Files after a particular record
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    Post subject: Reply to: Split Files after a particular record
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Wed Aug 29, 2012 6:10 am    Post subject: Reply to: Split Files after a particular record
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    Post subject: Reply to: Split Files after a particular record
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    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 High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


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