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+LISTCAT to print GDG info

 
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: Thu Jun 24, 2010 1:10 am    Post subject: SORT+LISTCAT to print GDG info
Reply with quote

I have this job and I want to modify it to print a little differently:

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('MYGDG.BASE.TEST') 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=(TTTT-TT-TT))) 


Right now I get something like this:
Code:
MYGDG.BASE.TEST                 1900-01-00
                                2009-01-01
MYGDG.BASE.TEST.G1201V00        1900-01-00
                                2010-04-25
MYGDG.BASE.TEST.G1202V00        1900-01-00
                                2010-04-26
MYGDG.BASE.TEST.G1203V00        1900-01-00
                                2010-04-27


Is there a way to print like this?
Code:
MYGDG.BASE.TEST                 2009-01-01
MYGDG.BASE.TEST.G1201V00        2010-04-25
MYGDG.BASE.TEST.G1202V00        2010-04-26
MYGDG.BASE.TEST.G1203V00        2010-04-27


Thank you.
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Jun 24, 2010 1:28 am    Post subject:
Reply with quote

How about posting a portion of your input?
Back to top
View user's profile Send private message
rmd3003

New User


Joined: 03 Jul 2006
Posts: 53

PostPosted: Thu Jun 24, 2010 1:29 am    Post subject:
Reply with quote

CICS Guy wrote:
How about posting a portion of your input?


I'm not sure what "INPUT" you are talking about? This job prints GDG info.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Jun 24, 2010 1:54 am    Post subject:
Reply with quote

Quote:
I want to modify it to print a little differently:


What are the "rules" for printing differently. Do you want the date from the second record of each pair in each case, or the highest date, or what?

It really would help if you showed an example of the input records you are operating on (that is, the GDG info resulting from the LISTCAT statement in &&L).
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Jun 24, 2010 3:00 am    Post subject:
Reply with quote

rmd3003 wrote:
CICS Guy wrote:
How about posting a portion of your input?


I'm not sure what "INPUT" you are talking about? This job prints GDG info.


rmd3003,

If your intention is to get the listing of create dates of your GDG's you need to sum the creation date values at pos 45 as the name and creation dates on different lines from the listcat output.

Remove the SORT FIELDS=COPY line and add these 2 lines

Code:

SORT FIELDS=(81,4,CH,A),EQUALS     
SUM FIELDS=(45,4,PD)               


Also remember that your output LRECL is 84 which has the seqnum at the end. You can remove them changing your OUTREC statement to the following.
Code:

OUTREC BUILD=(1,44,45,4,DT1,EDIT=(TTTT-TT-TT),80:X) 
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 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. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm


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