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
 

 

Need to know the current generation of GDG

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sunnybunny

New User


Joined: 29 Nov 2005
Posts: 49

PostPosted: Wed Oct 19, 2011 9:55 pm    Post subject: Need to know the current generation of GDG
Reply with quote

Hello all,

I have following requirement.

I have some set of file names. I need to know the following.
1. If dataset is GDG then need to know the current generation of file.
2. If dataset is not GDG then it should display as it is saying not a GDG file.


I am going to put all file names in one file as input and want to get output file with above mentioned two points.


Say my input file xxx.xxx.xxx contains following files.
a.a.a
b.b.b
c.c.c

output file need to have in following format
a.a.a is not a GDG file
b.b.b.G0012V00
c.c.c.G0009V00

Please help me on this.

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

Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1746
Location: Bloomington, IL

PostPosted: Wed Oct 19, 2011 10:15 pm    Post subject:
Reply with quote

Write a Rexx exec that reads the DSNs from a file. For each DSN, do a LISTCAT, OUTTRAPping the results. If the first trapped line does not contain the token "GDG BASE", it is not a GDG; otherwise, parse the last line containing the token "NONVSAM" for the highest version number (won't work if any of your GDGs have wrapped, but this usually takes a while).
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1722
Location: UK

PostPosted: Thu Oct 20, 2011 12:11 am    Post subject:
Reply with quote

Good Grief! How many times THIS YEAR has this sort of question been asked?
Back to top
View user's profile Send private message
sunnybunny

New User


Joined: 29 Nov 2005
Posts: 49

PostPosted: Thu Oct 20, 2011 12:38 am    Post subject: Reply to: Need to know the current generation of GDG
Reply with quote

Hi

Thanks for your reply.

I am not familiar with REXX...I started learning it. Can you please help me with the REXX code for this.

Thanks
Ram.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1746
Location: Bloomington, IL

PostPosted: Thu Oct 20, 2011 12:58 am    Post subject: Re: Reply to: Need to know the current generation of GDG
Reply with quote

sunnybunny wrote:
Hi

Thanks for your reply.

I am not familiar with REXX...I started learning it. Can you please help me with the REXX code for this.

Kids these days icon_rolleyes.gif

The Rexx:
Code:
/* Rexx */                                                             
/* Written Heisei 23.10.19 by Akatsukami-sama */                       
  trace o                                                             
/* Allocation of TULIN and TULOUT must be done if exec is not run in */
/* the background.                                                   */
  "EXECIO 1 DISKR TULIN"                                               
                                                                       
  do while (rc=0)                                                     
    pull dsn .                                                         
    x = outtrap("LC.")                                                 
    "LISTCAT ENTRIES('"dsn"')"                                         
    x = outtrap("OFF")                                                 
                                                                       
    if (pos("GDG BASE",lc.1)=0) then do                               
      line = dsn "is not a GDG"                                       
      push line                                                       
      "EXECIO 1 DISKW TULOUT"                                         
    end                                                               
    else if (lc.0=2) then do                                           
      line = "No generations of" dsn                                   
      push line                                                       
      "EXECIO 1 DISKW TULOUT"                                         
      end                                                             
      else do                                                         
        i = lc.0 - 1                                                   
        parse var lc.i . . g                                           
        p = lastpos('.',g)                                             
        gen = substr(g,p+1)                                           
        push g                                                         
        "EXECIO 1 DISKW TULOUT"                                       
      end                                                             
    "EXECIO 1 DISKR TULIN"                                             
  end                                                                 
/* If TULIN and TULOUT are allocated in the exec, they must also be  */
/* freed in it.                                                      */
  exit                                                                 
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7251

PostPosted: Thu Oct 20, 2011 1:00 am    Post subject: Reply to: Need to know the current generation of GDG
Reply with quote

Browse the forum for some likely-looking titles, try google.
Back to top
View user's profile Send private message
Phrzby Phil

Active Member


Joined: 31 Oct 2006
Posts: 962
Location: Richmond, Virginia

PostPosted: Thu Oct 20, 2011 5:32 pm    Post subject:
Reply with quote

There's also IDCAMS LISTCAT.

Write the report to a file and write a program or other extraction method to parse the report.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Get correct date and time when curren... balaji81_k DB2 24 Fri Oct 14, 2016 10:40 pm
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts alphanumeric sequence generation sivaprasad.gadhi COBOL Programming 6 Wed Mar 30, 2016 3:03 am
No new posts alphanumeric sequence generation sivaprasad.gadhi DFSORT/ICETOOL 8 Mon Mar 21, 2016 1:09 am
No new posts Retrieve current year or month using ... vnktrrd DFSORT/ICETOOL 15 Tue Mar 15, 2016 4:14 pm


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