GDG - creation date of multiple generations using (0) (-1)
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> Utilities

#1: GDG - creation date of multiple generations using (0) (-1) Author: BobGilbert PostPosted: Tue Sep 23, 2014 3:01 pm
    —
I have looked around a bit and hitting walls or multiple steps, I see a long way to come up what I need but think there may be a better way.

I am trying to capture the dates of various versions of a GDG just using the base and (0) (-1) etc.

I can get this using IKJEFT01 (LISTDS 'name' HISTORY) but need to convert the (0) to the version number first.

I can use IEFBR!4 and read the sysout and create a control card but then I am adding steps.

Is there a way using IKJEFT01 I can get the creation date of any specific version of a GDG. I already figured out if you give the GDG base only you get the creation of the last version, but I need for example (-3) creation date or even -10....hope this makes since

Is there an easier way, Thanks!

#2:  Author: kolusuLocation: San Jose PostPosted: Tue Sep 23, 2014 3:28 pm
    —
BobGilbert,

Use the following DFSORT JCL which will list all the gdg generations create date.

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('YOUR.GDG.BASE.NAME') ALL
//*                                                             
//STEP0200 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD DSN=&&L,DISP=(OLD,PASS)                           
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  OPTION COPY                                                   
  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=GROUP,RECORDS=2,PUSH=(81:17,44),           
      BEGIN=(1,8,CH,EQ,C'GDG BASE',OR,4,7,CH,EQ,C'NONVSAM')),   
  IFTHEN=(WHEN=(37,8,CH,EQ,C'CREATION'),                       
  OVERLAY=(53:53,8,UFF,M11,LENGTH=7,X))                         
                                                               
  OUTFIL INCLUDE=(37,8,CH,EQ,C'CREATION'),                     
  BUILD=(81,44,C' CREATED ON : ',53,7,Y4T,TOGREG=Y4T(-),80:X)   
//*

#3:  Author: BobGilbert PostPosted: Tue Sep 23, 2014 3:45 pm
    —
Thank you, I saw the information in the tricks manual,

My issue I am having is in the middle of a proc. I have a symbolicly resolved dataset name with the version as a (0), (-3) etc...

The DFSORT gets them all. I need the specific one being read in the proc at the time. I had once thought I could just write all out with the syncsort and create a temporary lookup table and cound backwards (or soemthing like that) but again I am getting complicated.

There may not be any un complicated way?

#4:  Author: kolusuLocation: San Jose PostPosted: Tue Sep 23, 2014 4:31 pm
    —
BobGilbert wrote:
Thank you, I saw the information in the tricks manual,

My issue I am having is in the middle of a proc. I have a symbolicly resolved dataset name with the version as a (0), (-3) etc...

The DFSORT gets them all. I need the specific one being read in the proc at the time. I had once thought I could just write all out with the syncsort and create a temporary lookup table and cound backwards (or soemthing like that) but again I am getting complicated.

There may not be any un complicated way?


Bob Gilbert,

It is quite simple to accommodate that. Pass the gdg base name in IGDG and generation number as a max of 4 bytes in IGEN ie. '+0', '-3' , '-21', or '-256'

Code:

// SET IGDG='Your.GDG.Base'                                         
// SET IGEN='-3'                 
//*                                     
//STEP0100 EXEC PGM=IKJEFT01,PARM='LISTCAT ENT(''&IGDG'') ALL'         
//SYSTSPRT DD DSN=&&L,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE),             
//            DCB=(LRECL=80,RECFM=FB,BLKSIZE=0)                       
//SYSTSIN  DD DUMMY                                                   
//*                                                                   
//STEP0200 EXEC PGM=SORT,PARM='JP1"&IGEN"'                             
//SYSOUT   DD SYSOUT=*                                                 
//SYMNOUT  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=GROUP,RECORDS=2,PUSH=(81:17,44),                 
      BEGIN=(1,8,CH,EQ,C'GDG BASE',OR,4,7,CH,EQ,C'NONVSAM')),         
  IFTHEN=(WHEN=(37,8,CH,EQ,C'CREATION'),                               
  OVERLAY=(53:53,8,UFF,M11,LENGTH=7,X))           
                     
  SORT FIELDS=(81,44,CH,D),EQUALS                                     
                                                                       
  OUTREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(81,44),PUSH=(135:ID=3)),         
  IFTHEN=(WHEN=INIT,OVERLAY=(135:135,3,ZD,SUB,+1,M11,LENGTH=3,         
                             140:JP1,6X,140:140,8,UFF,M11,LENGTH=3,5X))
                                                                       
  OUTFIL INCLUDE=(37,8,CH,EQ,C'CREATION',AND,(135,3,CH,EQ,140,3,CH)), 
  BUILD=(81,44,C' CREATED ON : ',53,7,Y4T,TOGREG=Y4T(-),80:X)
//*

#5:  Author: BobGilbert PostPosted: Wed Sep 24, 2014 12:32 pm
    —
Thank you very much! One step and I can add the version as another parm, which I had intended to do anyhow!

#6:  Author: CraigGLocation: Viginia, USA PostPosted: Wed Sep 24, 2014 2:27 pm
    —
BobGilbert wrote:
Thank you very much! One step and I can add the version as another parm, which I had intended to do anyhow!


You had better learn the difference between versions and generations!!



MVSFORUMS.com -> Utilities


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group