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
 

 

Wanted to check if GDG has no versions
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Wanted to check if GDG has no versions
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Jul 11, 2012 6:03 pm    Post subject: Reply to: Wanted to check if GDG has no versions
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    Post subject:
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: 785
Location: Chennai, India

PostPosted: Wed Jul 11, 2012 6:09 pm    Post subject:
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://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    Post subject:
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: 785
Location: Chennai, India

PostPosted: Wed Jul 11, 2012 6:33 pm    Post subject:
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    Post subject:
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: 785
Location: Chennai, India

PostPosted: Wed Jul 11, 2012 6:43 pm    Post subject:
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    Post subject:
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    Post subject:
Reply with quote

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

Active Member


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

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

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

Senior Member


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

PostPosted: Wed Jul 11, 2012 7:40 pm    Post subject:
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    Post subject:
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: 785
Location: Chennai, India

PostPosted: Wed Jul 11, 2012 7:49 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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

Senior Member


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

PostPosted: Wed Jul 11, 2012 8:04 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Wed Jul 11, 2012 8:22 pm    Post subject: Reply to: Wanted to check if GDG has no versions
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    Post subject: Re: Reply to: Wanted to check if GDG has no versions
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts Syntax to check the first 4 digits of... kshirabdhi DFSORT/ICETOOL 10 Tue May 03, 2016 12:21 pm
No new posts Check special resource availability w... pinimo JCL & VSAM 8 Fri Apr 15, 2016 8:18 pm
No new posts check nth row from a PS file bachi234 DFSORT/ICETOOL 2 Fri Feb 19, 2016 5:31 pm


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