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
 
Need to split basd on header without any matching detail rec

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Need to split basd on header without any matching detail rec
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm
No new posts Mainframe dataset split purushottam DFSORT/ICETOOL 13 Tue Aug 29, 2017 12:28 pm
No new posts Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm

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