View previous topic :: View next topic
|
Author |
Message |
raghuraman123
New User
Joined: 09 Nov 2017 Posts: 10 Location: India
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Take a look at a utility I put on here some years ago, CSIUTIL - it may help you |
|
Back to top |
|
|
raghuraman123
New User
Joined: 09 Nov 2017 Posts: 10 Location: India
|
|
|
|
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 |
|
|
raghuraman123
New User
Joined: 09 Nov 2017 Posts: 10 Location: India
|
|
|
|
Robert, the generation are in DISK(DASD) |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
Back to top |
|
|
|