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
 

 

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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


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