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 numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am

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