IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

GDG gen check using REXX


IBM Mainframe Forums -> CLIST & REXX
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
raghuraman123

New User


Joined: 09 Nov 2017
Posts: 10
Location: India

PostPosted: Wed Apr 18, 2018 9:18 pm
Reply with quote

is it possible to check GDG current version empty or not? if its empty return the gdg base name as output, I have some 100 different gdg bases which we check manually whether the current gen is empty, I wish to automate this using REXX, any suggestion welcome.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8697
Location: Dubuque, Iowa, USA

PostPosted: Wed Apr 18, 2018 9:40 pm
Reply with quote

Quote:
is it possible to check GDG current version empty or not?
First, you need to get the terminology right. A GDG can have generations and versions, and they are different. So the question becomes, do you mean "current version" the way you said, or do you mean "current generation"? Are the generations on disk or tape?
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Thu Apr 19, 2018 3:19 am
Reply with quote

As Mr. Sample correctly says, terminology is critically important, and there is a critical difference between a "generation" in GDGs and a "version" in a GDG generation.

Fortunately, there is no such thing as an "empty" version in a GDG generation. I presume you really mean a GDG index with no generations.

I will assume you understand how to use the Rexx OUTTRAP capability. You need to "trap" the output from the TSO commands I will discuss later, but you should be able to discard most of this output for some of these commands.

Now then, your first task is to determine if the GDG index exists. You run the command LISTCAT ENTRIES('GDG index'). You can trap and discard the output from this command. If the return code from the command is not 0, the index does not exist.

If the index exists, the run LISTCAT LEVEL('GDG index') If the return code is 0, you want to review this output. You want to trap and examine the output from this command. You want to find at least one line that starts with 'NONVSAM ------- ' If you find at least one NONVSAM line, then the GDG is not empty.

Now that's not so hard, is it?
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Apr 19, 2018 12:19 pm
Reply with quote

Take a look at a utility I put on here some years ago, CSIUTIL - it may help you
Back to top
View user's profile Send private message
raghuraman123

New User


Joined: 09 Nov 2017
Posts: 10
Location: India

PostPosted: Thu Apr 19, 2018 4:19 pm
Reply with quote

thanks Robert, I learned the diff b/w version and generation, I will ask the question again with a scenario.

A**.XF.BMGX.XF76001 (GDG base)
A**.XF.BMGX.XF76001.G0279V00
A**.XF.BMGX.XF76001.G0280V00 (Current Generation)

Like above I have 100 different GDG's which I should check whether current generation is empty or not for all. Hope I am not confusing this time.

Expat, i will check on it.

And,Thanks for the responses.
Back to top
View user's profile Send private message
raghuraman123

New User


Joined: 09 Nov 2017
Posts: 10
Location: India

PostPosted: Thu Apr 19, 2018 4:25 pm
Reply with quote

Robert, the generation are in DISK(DASD)
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Apr 19, 2018 4:46 pm
Reply with quote

topic locked
it belongs to the [in]famous category of
ibmmainframes.com/viewtopic.php?t=20820
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top