Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Execute JCL step based on the content... sprikitik JCL & VSAM 2 Tue Oct 03, 2017 10:03 am
This topic is locked: you cannot edit posts or make replies. PS file data should be passed as symb... d_sarlie JCL & VSAM 15 Tue Oct 03, 2017 5:18 am
No new posts Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Compare yesterday's date to the one o... migusd SYNCSORT 11 Fri Sep 22, 2017 11:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us