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
 

 

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 Matching with Key at different postions. rajatbagga DFSORT/ICETOOL 12 Wed Nov 09, 2016 10:58 am
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts how to split records based on specifi... Venkata Ramayya DFSORT/ICETOOL 6 Wed Sep 28, 2016 3:20 am
No new posts Increase the screen size after split mistah kurtz TSO/ISPF 2 Fri Sep 02, 2016 6:39 pm
No new posts TSO Logon Failing - Acount Not matching SLNewton TSO/ISPF 1 Thu Aug 25, 2016 9:37 pm


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