View previous topic :: View next topic
|
Author |
Message |
sumitmalik29 Warnings : 1 New User
Joined: 10 Feb 2008 Posts: 19 Location: bhuneswar
|
|
|
|
Hi
I need to know whether a previous gdg generation exist or not using relative generation number for example test.gdgdatasrt(-4) ,
//JS10 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
LISTCAT LEVEL('TEST.GDG.DATASET(-4)')
/*
I am receiving the message as "(' DOES NOT ADHERE TO RESTRICTIONS
Thanks for your help in advance
Regards
Sumit |
|
Back to top |
|
|
sumitmalik29 Warnings : 1 New User
Joined: 10 Feb 2008 Posts: 19 Location: bhuneswar
|
|
|
|
Hi
I searched another post
www.ibmmainframes.com/about48158.html
and If i have understood correctly we cannot use relative parameter.
It would be great if we have some other aternative preferably JCL
Thanks
Sumit |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Why not use LISTCAT LEVEL(TEST.GDG.DATASET), put the IDCAMS output into a data set, and scan that data set for what you want to know? |
|
Back to top |
|
|
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
Another approach is BPXWDYN:
Code: |
/* rexx */
x = BPXWDYN("ALLOC DD(QQQ) DA('xxxx.yyyyyy.testGDG(-4)') " ,
"SHR REUSE GDGNT")
say x
DO I = 1 TO S99MSG.0
SAY "message = " S99MSG.I
END |
If the allocation fails, then the data set is not in the catalog (see S99MSG.i to be sure). |
|
Back to top |
|
|
|