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 one file into many depending upon condition.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
VIKAS GAIKWAD

New User


Joined: 30 Nov 2006
Posts: 33
Location: MUMBAI

PostPosted: Wed May 23, 2007 12:59 pm    Post subject: Split one file into many depending upon condition.
Reply with quote

Hi,

The format of file is as follows:

Code:

HH     1234   
DD12     345455 Jon 
TT       000000005513224 
HH     1234   
DD12     393466 Deva
TT       000000009913224 
HH     1235       
DD12     554458 ABC
DD12     566926 PQR
TT      000000000444850 
HH     1930         
.
.
.
.


The requirement is I want all records having Header 1234 (& the corresponding Descriptor & Trailer) records in one file. Header 1235 in other & so on..

Now in output should be as follows
File1

Code:

HH     1234   
DD12     345455 Jon 
TT       000000005513224 
HH     1234   
DD12     393466 Deva
TT       000000009913224


File2

Code:

HH     1235       
DD12     554458 ABC
DD12     566926 PQR
TT      000000000444850 


File3

Code:

HH     1930   
.
.
.


so on..

I know by using program we can do it. Is it possible by using Syncsort?
Back to top
View user's profile Send private message

UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 757
Location: Germany

PostPosted: Wed May 23, 2007 4:47 pm    Post subject:
Reply with quote

Hi !

Indeed. By using outfile option. Before you have to make shure, that the sortcreteria is in every line at a specific position. Therefore you could use a littel handmade programm.

Regards, UmeySan

JCL-Example:

//STEP02 EXEC PGM=SORT,PARM='HIPRMAX=OPTIMAL'
//SYSOUT DD SYSOUT=*
//*
//SORTWK01 DD UNIT=(SYSDA),SPACE=(TRK,(5,1),RLSE)
//*
//SORTIN DD DISP=SHR,DSN=WLEQ.I041.SA00.KWG6.SCMAE.KWG18
//*
//SORTOF1 DD DSN=IER1337.USER.SORTOUT.OUT01,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(10,1),RLSE),
// RECFM=FB,LRECL=159
//SORTOF2 DD DSN=IER1337.USER.SORTOUT.OUT02,
// DISP=(NEW,CATLG,DELETE),UNIT=SYSDA,
// SPACE=(CYL,(10,1),RLSE),
// RECFM=FB,LRECL=159
//*
//SYSIN DD *
SORT FIELDS=COPY
RECORD TYPE=F
OUTFIL FILES=1,
INCLUDE=(02,10,CH,EQ,12,10,CH),
OUTREC=(01,159)
OUTFIL FILES=2,
INCLUDE=(02,10,CH,NE,12,10,CH),
OUTREC=(01,159)
/*
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 SSH - known_hosts file configuration vasanthz All Other Mainframe Topics 2 Wed Jul 26, 2017 2:10 am
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How to generate a new unique Input fi... for1ranjith CLIST & REXX 11 Sat Jul 01, 2017 12:09 pm


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