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
 

 

Help me modify my SORT, I'm almost there..........

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

New User


Joined: 03 Jul 2006
Posts: 53

PostPosted: Sat Sep 25, 2010 12:05 am    Post subject: Help me modify my SORT, I'm almost there..........
Reply with quote

Right now I'm suing this SORT to print GDG creation dates:
Code:
//STEP0100 EXEC PGM=IKJEFT01                                         
//SYSTSPRT DD DSN=&&L,                                               
//            DISP=(,PASS),SPACE=(CYL,(1,1),RLSE),                   
//            DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)                     
//SYSTSIN  DD *                                                     
  LISTCAT ENT('TEST.FILE.COMPLETE') ALL                             
//*                                                                 
//STEP0200 EXEC PGM=SORT                                             
//SYSOUT   DD SYSOUT=*                                               
//SORTIN   DD DSN=&&L,DISP=(OLD,PASS)                               
//SORTOUT  DD SYSOUT=*                                               
//SYSIN    DD *                                                     
  INCLUDE COND=(01,8,CH,EQ,C'GDG BASE',OR,                           
                04,7,CH,EQ,C'NONVSAM',OR,                           
                37,8,CH,EQ,C'CREATION')                             
  INREC IFTHEN=(WHEN=(1,8,CH,EQ,C'GDG BASE',OR,4,7,CH,EQ,C'NONVSAM'),
  BUILD=(17,44,+0,TO=PD,LENGTH=4,81:SEQNUM,4,ZD)),                   
  IFTHEN=(WHEN=(37,8,CH,EQ,C'CREATION'),                             
  BUILD=(44X,X'01',55,6,UFF,PD,LENGTH=3,81:SEQNUM,4,ZD))             
                                                                     
  SORT FIELDS=COPY                                               
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(45:45,4,DT1,EDIT=(TTTTTTTT)))
/*                                                               


This is what I get:
Code:
TEST.FILE.COMPLETE          19000100                            0001
                            20070723                            0001
TEST.FILE.COMPLETE.G0068V00 19000100                            0002
                            20100220                            0002
TEST.FILE.COMPLETE.G0069V00 19000100                            0003
                            20100303                            0003
TEST.FILE.COMPLETE.G0070V00 19000100                            0004
                            20100517                            0004
TEST.FILE.COMPLETE.G0071V00 19000100                            0005
                            20100603                            0005
TEST.FILE.COMPLETE.G0072V00 19000100                            0006
                            20100712                            0006
TEST.FILE.COMPLETE.G0073V00 19000100                            0007
                            20100819                            0007
TEST.FILE.COMPLETE.G0074V00 19000100                            0008
                            20100822                            0008
TEST.FILE.COMPLETE.G0075V00 19000100                            0009
                            20100926                            0009


Now, how do I get this result?
Code:
TEST.FILE.COMPLETE          20070723
TEST.FILE.COMPLETE.G0068V00 20100220
TEST.FILE.COMPLETE.G0069V00 20100303
TEST.FILE.COMPLETE.G0070V00 20100517
TEST.FILE.COMPLETE.G0071V00 20100603
TEST.FILE.COMPLETE.G0072V00 20100712
TEST.FILE.COMPLETE.G0073V00 20100819
TEST.FILE.COMPLETE.G0074V00 20100822
TEST.FILE.COMPLETE.G0075V00 20100926
Back to top
View user's profile Send private message

sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Sat Sep 25, 2010 12:33 am    Post subject:
Reply with quote

rmd3003,
See if this works.. UNTESTED

Code:
 INCLUDE COND=(01,8,CH,EQ,C'GDG BASE',OR,                               
                04,7,CH,EQ,C'NONVSAM',OR,                               
                37,8,CH,EQ,C'CREATION')                                 
  INREC IFTHEN=(WHEN=(1,8,CH,EQ,C'GDG BASE',OR,4,7,CH,EQ,C'NONVSAM'),   
  BUILD=(17,44,+0,TO=PD,LENGTH=4,81:SEQNUM,4,ZD)),                     
  IFTHEN=(WHEN=(37,8,CH,EQ,C'CREATION'),                               
  BUILD=(44X,X'01',55,6,UFF,PD,LENGTH=3,81:SEQNUM,4,ZD))               
                                                                       
  SORT FIELDS=COPY                                                     
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(45:45,4,DT1,EDIT=(TTTTTTTT))),     
         IFTHEN=(WHEN=GROUP,BEGIN=(29,4,ZD,EQ,1900),PUSH=(85:1,28))     
  OUTFIL INCLUDE=(1,4,CH,EQ,C' '),BUILD=(85,28,29,52)                   


Thanks,
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 53

PostPosted: Sat Sep 25, 2010 12:59 am    Post subject: Reply to: Help me modify my SORT, I'm almost there..........
Reply with quote

Thank you. It works, kind of.... GDG name dissapeared icon_eek.gif but dates are good....... I'll try to get GDG names back icon_wink.gif
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Sat Sep 25, 2010 1:10 am    Post subject:
Reply with quote

rmd3003,
Check field positions, I assumed field positions from the file output you were getting.

The logic is to PUSH gdg names at 85th position,whenever 1900 is encountered at position 29 (or you can use 19000100 for 8 bytes) using GROUP. This way you will have GDG names on both the records for the group. Now, we want to include only record where GDG name is not populated, and repopulate GDG names from 85th position and rest of the record as it is.

Like I said, It was untested but the logic should work if you correct field positions.

Thanks,
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 53

PostPosted: Sat Sep 25, 2010 1:29 am    Post subject: Reply to: Help me modify my SORT, I'm almost there..........
Reply with quote

Thank you, worked great. icon_biggrin.gif
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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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