View previous topic :: View next topic
|
Author |
Message |
knilesh23
New User
Joined: 30 Mar 2009 Posts: 18 Location: Pune
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
knilesh23
New User
Joined: 30 Mar 2009 Posts: 18 Location: Pune
|
|
|
|
Yes, its generations
please advice |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
Back to top |
|
|
knilesh23
New User
Joined: 30 Mar 2009 Posts: 18 Location: Pune
|
|
|
|
I guess with the help of LISTCAT we can check if GDG base info not its generation avaibility. |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
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 |
|
|
knilesh23
New User
Joined: 30 Mar 2009 Posts: 18 Location: Pune
|
|
|
|
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 |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
knilesh23
New User
Joined: 30 Mar 2009 Posts: 18 Location: Pune
|
|
|
|
yes |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Did you try with LISTCAT and SORTing approaches? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
knilesh23
New User
Joined: 30 Mar 2009 Posts: 18 Location: Pune
|
|
|
|
Its Work.
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 |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Welcome. But Anuj's example looks better. Please review. |
|
Back to top |
|
|
knilesh23
New User
Joined: 30 Mar 2009 Posts: 18 Location: Pune
|
|
|
|
Hey Anuj,
That also Work
which is very much better than
Thanks again |
|
Back to top |
|
|
knilesh23
New User
Joined: 30 Mar 2009 Posts: 18 Location: Pune
|
|
|
|
Thanks Anuj |
|
Back to top |
|
|
Ed Goodman
Active Member
Joined: 08 Jun 2011 Posts: 556 Location: USA
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
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 |
|
|
knilesh23
New User
Joined: 30 Mar 2009 Posts: 18 Location: Pune
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
knilesh23
New User
Joined: 30 Mar 2009 Posts: 18 Location: Pune
|
|
|
|
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 |
|
|
knilesh23
New User
Joined: 30 Mar 2009 Posts: 18 Location: Pune
|
|
|
|
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 |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
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 |
|
|
|