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: 755
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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts File processing vishwakotin Mainframe Interview Questions 9 Fri Apr 28, 2017 11:38 am


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