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
 
Sort groups of Records by value in Trailer

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
skkp2006

New User


Joined: 14 Jul 2006
Posts: 93
Location: Chennai,India

PostPosted: Thu Jun 26, 2008 3:19 pm    Post subject: Sort groups of Records by value in Trailer
Reply with quote

Hi,

I have an input file of lrecl 85 and RECFM FB and i need to sort the files based on the % value in the trailer.

The input file looks like

Code:
 NUMBER:125 .....
     125xxxxxxxxxxxxxxxxxxx                xxxxxxxxxxxx  xxx
     125xxxxxxxxxxxxxxxxxxx                xxxxxxxxxxxx  xxx
     125xxxxxxxxxxxxxxxxxxx                xxxxxxxxxxxx  xxx
 125                                                        0000003 12.00%
 NUMBER:129 .....
     129xxxxxxxxxxxxxxxxxxx                xxxxxxxxxxxx  xxx
 129                                                        0050001 02.00%
 NUMBER:130 .....
     130xxxxxxxxxxxxxxxxxxx                xxxxxxxxxxxx  xxx
     130xxxxxxxxxxxxxxxxxxx                xxxxxxxxxxxx  xxx
     130xxxxxxxxxxxxxxxxxxx                xxxxxxxxxxxx  xxx
 130                                                        0087003  3.44%



And the Expected output is

Code:
 NUMBER:129 .....
     129xxxxxxxxxxxxxxxxxxx                xxxxxxxxxxxx  xxx
 129                                                        0050001 02.00%
 NUMBER:130 .....
     130xxxxxxxxxxxxxxxxxxx                xxxxxxxxxxxx  xxx
     130xxxxxxxxxxxxxxxxxxx                xxxxxxxxxxxx  xxx
     130xxxxxxxxxxxxxxxxxxx                xxxxxxxxxxxx  xxx
 130                                                        0087003  3.44%
 NUMBER:125 .....
     125xxxxxxxxxxxxxxxxxxx                xxxxxxxxxxxx  xxx
     125xxxxxxxxxxxxxxxxxxx                xxxxxxxxxxxx  xxx
     125xxxxxxxxxxxxxxxxxxx                xxxxxxxxxxxx  xxx
 125                                                        0000003 12.00%



There wont be any duplicates in the input file and the number of detail records may vary for any account number.The trailer can be identified using the account number from the header. Is it possible with DFSORT to solve the issue or do i need to write a program for this?

Thanks for the help.....

Syam
Back to top
View user's profile Send private message

Skolusu

Senior Member


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

PostPosted: Fri Jun 27, 2008 1:32 am    Post subject: Reply to: Sort groups of Records by value in Trailer
Reply with quote

Syam,

The following DFSORT/ICETOOL JCL will give you the desired results


Code:

//STEP0100 EXEC PGM=ICETOOL 
//TOOLMSG  DD SYSOUT=*       
//DFSMSG   DD SYSOUT=*       
//IN       DD DSN=your input 85 byte lrecl file,DISP=SHR
//T1       DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)     
//OUT      DD SYSOUT=*                                         
//TOOLIN   DD *                                               
  SPLICE FROM(IN) TO(T1) ON(94,8,CH) KEEPNODUPS WITHALL -     
  WITH(1,93) KEEPBASE USING(CTL1)                             
  SORT FROM(T1) USING(CTL2)                                   
//CTL1CNTL DD *                                               
  INREC IFTHEN=(WHEN=INIT,                                     
  PARSE=(%=(ENDBEFR=C'%'),%01=(SUBPOS=6,FIXLEN=6))),           
  IFTHEN=(WHEN=INIT,OVERLAY=(110:%01,UFF,EDIT=(TTTTTT))),     
  IFTHEN=(WHEN=INIT,OVERLAY=(86:SEQNUM,8,ZD,SEQNUM,8,ZD)),     
  IFTHEN=(WHEN=(1,6,CH,EQ,C'NUMBER'),OVERLAY=(94:SEQNUM,8,ZD)),
  IFTHEN=(WHEN=NONE,OVERLAY=(102:SEQNUM,8,ZD,                 
          94:94,8,ZD,SUB,102,8,ZD,M11,LENGTH=8))               
                                                               
  SORT FIELDS=(94,8,CH,A,110,6,CH,D)                           
/*                                                             
//CTL2CNTL DD *                                               
  OPTION EQUALS                                               
  SORT FIELDS=(110,6,CH,A,86,8,CH,A)                           
  OUTFIL FNAMES=OUT,BUILD=(01,85)                             
/*                                                             


Hope this helps...
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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm

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