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
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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