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

Split one file into many depending upon condition.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 771
Location: Germany

PostPosted: Wed May 23, 2007 4:47 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top