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

Need to split basd on header without any matching detail rec


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
D Rishi

New User


Joined: 01 Mar 2010
Posts: 21
Location: India

PostPosted: Fri Feb 25, 2011 4:30 pm
Reply with quote

Hi,

I have a file (RECFM=FBA,LRECL=160) which i need to split into 4 based on header.

please find the sample below..

REPORT - A
0000123account
0011123account
4560123account
REPORT - A
0978693account
4534342account
.
.
.
REPORT - B
0230123account
0011123account
4560123account
REPORT - B
0123123account
0978693account
4534342account
.
.
REPORT - C
0000123account
0014523account
0230123account
REPORT - C
0978693account
4534342account
.
.
REPORT - D
0000123account
4560123account
REPORT - D
0123123account
.
.

I have to separate Report A,B,C,D to different files using sort..

there are no matchhing fields under the headers..

plz suugest a method..
thanks in advance..
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Fri Feb 25, 2011 10:45 pm
Reply with quote

D Rishi,

Assuming that you have the split indicator (A,B,C,D) in pos 11 and 'REPORT' string starting in pos 2, the following DFSORT JCL will give you the desired results.

Code:

//STEP0100 EXEC PGM=SORT   
//SYSOUT   DD SYSOUT=*     
//SORTIN   DD DSN=your input RECFM=FBA,LRECL=160 file,DISP=SHR
//RPTA     DD SYSOUT=*                                                 
//RPTB     DD SYSOUT=*                                                 
//RPTC     DD SYSOUT=*                                                 
//RPTD     DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  SORT FIELDS=COPY                                                     
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(2,6,CH,EQ,C'REPORT'),PUSH=(161:11,1))
                                                                       
  OUTFIL FNAMES=RPTA,BUILD=(1,160),INCLUDE=(161,1,CH,EQ,C'A')           
  OUTFIL FNAMES=RPTB,BUILD=(1,160),INCLUDE=(161,1,CH,EQ,C'B')           
  OUTFIL FNAMES=RPTC,BUILD=(1,160),INCLUDE=(161,1,CH,EQ,C'C')           
  OUTFIL FNAMES=RPTD,BUILD=(1,160),INCLUDE=(161,1,CH,EQ,C'D')           
//*
Back to top
View user's profile Send private message
D Rishi

New User


Joined: 01 Mar 2010
Posts: 21
Location: India

PostPosted: Mon Feb 28, 2011 12:47 pm
Reply with quote

its working..thanks..
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL/SORT to Split Records SYNCSORT 28
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Synctool-dynamic split job for varyin... JCL & VSAM 7
No new posts Rexx pattern matching on PS qualifer ... CLIST & REXX 1
Search our Forums:

Back to Top