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

Wanted to check if GDG has no versions


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
knilesh23

New User


Joined: 30 Mar 2009
Posts: 18
Location: Pune

PostPosted: Wed Jul 11, 2012 5:58 pm
Reply with quote

Hi,

I wanted to check If GDG has no version in that case step has to give non zero return code.

Please advice

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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jul 11, 2012 6:03 pm
Reply with quote

No VERSION? Do you mean GENERATION?

This has been discussed a lot on this board, although not in this particular forum. Have you used the SEARCH towards the top of the scree?
Back to top
View user's profile Send private message
knilesh23

New User


Joined: 30 Mar 2009
Posts: 18
Location: Pune

PostPosted: Wed Jul 11, 2012 6:07 pm
Reply with quote

Yes, its generations

please advice
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed Jul 11, 2012 6:09 pm
Reply with quote

With DFSORT?

Yes, "Smart DFSORT Tricks" doc has some examples to parse LISTCAT on GDG base output.

Please review the examples; that might the starting point for your case

ftp.software.ibm.com/storage/dfsort/mvs/sorttrck.pdf
Back to top
View user's profile Send private message
knilesh23

New User


Joined: 30 Mar 2009
Posts: 18
Location: Pune

PostPosted: Wed Jul 11, 2012 6:24 pm
Reply with quote

I guess with the help of LISTCAT we can check if GDG base info not its generation avaibility.
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed Jul 11, 2012 6:33 pm
Reply with quote

If there are NO active generations, you'll see the below message in LISTCAT output.

Code:
     ASSOCIATIONS--------(NULL) 


Please test and let us know.
Back to top
View user's profile Send private message
knilesh23

New User


Joined: 30 Mar 2009
Posts: 18
Location: Pune

PostPosted: Wed Jul 11, 2012 6:38 pm
Reply with quote

Yes It is showing the same message.
But How we can handle/use that in job.

Ques : I wanted to check if gdg has generations or not. IF it has generation then return code should be zero otherwise job should be ended with non-zero return code.

As i am using that return code in next step of my job.

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

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed Jul 11, 2012 6:43 pm
Reply with quote

STEP1: Catch output of LISTCAT on GDG
STEP2: SORT, Check for "ASSOCIATIONS--------(NULL)" entry and set non-Zero RC
STEP3: YOUR next STEP, handle previous step RC
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Jul 11, 2012 7:00 pm
Reply with quote

Quote:
I wanted to check if gdg has generations or not.


actually, you are looking to see if there are any active associations
Back to top
View user's profile Send private message
knilesh23

New User


Joined: 30 Mar 2009
Posts: 18
Location: Pune

PostPosted: Wed Jul 11, 2012 7:28 pm
Reply with quote

yes
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed Jul 11, 2012 7:33 pm
Reply with quote

Did you try with LISTCAT and SORTing approaches?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Jul 11, 2012 7:40 pm
Reply with quote

In a bad mood though, have you tried, LISTCAT LVL on gdg base?
Code:
//S1 EXEC PGM=IDCAMS               
//SYSPRINT DD SYSOUT=*             
//*                               
//SYSIN DD *                       
  LISTCAT LVL('GDG.BASE')
//*                               
If no generations is associated with it, IDCAMS will genrate RC=4 else RC=0.
Back to top
View user's profile Send private message
knilesh23

New User


Joined: 30 Mar 2009
Posts: 18
Location: Pune

PostPosted: Wed Jul 11, 2012 7:47 pm
Reply with quote

Its Work. icon_smile.gif

Thanks Gnana Sekaran Nallathambi

I have use below steps which can be useful for future references.

Steps 1 : LISTCAT

Step2: Get the string 'ASSOCIATIONS--------(NULL)' and copied into another file

Step3: Check that ps file for empty check using IDCAM

STEP4 : nonzero return code (MAXX=4) for no generation and zero retrn code for active generations ( This cod checking for previous step)

Step5 : use that code in next step
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Wed Jul 11, 2012 7:49 pm
Reply with quote

Welcome. But Anuj's example looks better. Please review.
Back to top
View user's profile Send private message
knilesh23

New User


Joined: 30 Mar 2009
Posts: 18
Location: Pune

PostPosted: Wed Jul 11, 2012 7:52 pm
Reply with quote

Hey Anuj,

That also Work icon_biggrin.gif
which is very much better than

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

New User


Joined: 30 Mar 2009
Posts: 18
Location: Pune

PostPosted: Wed Jul 11, 2012 7:53 pm
Reply with quote

Thanks Anuj icon_smile.gif
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Wed Jul 11, 2012 7:54 pm
Reply with quote

If you are using DFSORT to check for the line, then look into the option that returns a different return code for an empty output file. It's an option you can put in during the actual sort step. It's like "NULLRC" or something like that. It would save you a step.

Also, something to think about: What if all the active generations are empty? Is that OK? Or do you want to do the same thing with that situation?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Jul 11, 2012 8:04 pm
Reply with quote

Glad it helped.

Should I move the topic to SMS & VSAM part of the Forum? I don't see if there is something DFSort related in this, specifially.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Wed Jul 11, 2012 8:22 pm
Reply with quote

If you can just wait a couple of hours in case Kolusu wants to illuminate the DFSORT trick, then maybe we can split it (again) leaving the DFSORT stuff here and shipping off the rest?
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Jul 11, 2012 9:48 pm
Reply with quote

Bill Woodger wrote:
If you can just wait a couple of hours in case Kolusu wants to illuminate the DFSORT trick, then maybe we can split it (again) leaving the DFSORT stuff here and shipping off the rest?


IDCAMS is the way to do it. DFSORT cannot be used in this case as the System rejects right away as "dataset not found"(base name specified as sortin) if the GDG does not have any generations. With IDCAMS listcat you are coding the GDGbase name in the sysin and the system doesn't validate the existence.

So you can move this topic to the appropriate forum.
Back to top
View user's profile Send private message
knilesh23

New User


Joined: 30 Mar 2009
Posts: 18
Location: Pune

PostPosted: Thu Jul 12, 2012 4:31 pm
Reply with quote

Hi,
one more thing I would like to add
--> LISTCAT LVL('GDG.BASE')
above step works fine and returning RC=4 but in the later step when I am unable to use that RC=4 in the cond of next step because job is checking generations before processing and as GDG has no generation, so it is throughing JCL Eror.

Please suggest.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Jul 12, 2012 4:51 pm
Reply with quote

Is that your assumption just after looking at the message/s generated by the "JCL-syntax-checker-tool" at your shop? Or you actually SUBmitted the Job?

What COND have you used?
Back to top
View user's profile Send private message
knilesh23

New User


Joined: 30 Mar 2009
Posts: 18
Location: Pune

PostPosted: Thu Jul 12, 2012 5:34 pm
Reply with quote

Anuj,
One thing I would like to ask,
when we gave any of the GDG base name LISTCAT LVL('XYZ)
and if I do have another gdg base name 'XYZ.BKP' present/catlg then above list cat command is reading both and because of that job is ending with maxx=00.
Back to top
View user's profile Send private message
knilesh23

New User


Joined: 30 Mar 2009
Posts: 18
Location: Pune

PostPosted: Thu Jul 12, 2012 5:41 pm
Reply with quote

for above example below messages are getting

READY
LISTCAT LVL
GDG BASE -----
IN-CAT --
READY
END

and I created new GDG base not having bkp or same qualifing name (HLQ and other)

READY
LISTCAT LVL ('NEW.GDG.BASE')
ENTRY NEW.GDG.BASE NOT FOUND+
** VSAM CATALOG RETURN CODE IS 8
** NEW.GDG.BASE NOT LISTED
LASTCC=4
READY
END
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Jul 12, 2012 5:43 pm
Reply with quote

knilesh23 wrote:
Anuj,
One thing I would like to ask,
when we gave any of the GDG base name LISTCAT LVL('XYZ)
and if I do have another gdg base name 'XYZ.BKP' present/catlg then above list cat command is reading both and because of that job is ending with maxx=00.


And you have a GDG base with 1 qualifier?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts How to check whether who renamed the ... JCL & VSAM 3
No new posts No ++JCLIN, APPLY CHECK job JCL & VSAM 1
No new posts EMPTY file check scenario JCL & VSAM 6
Search our Forums:

Back to Top