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

listcat jcl GDG with relative genration number


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

New User


Joined: 10 Feb 2008
Posts: 19
Location: bhuneswar

PostPosted: Sat Jul 11, 2015 6:27 pm
Reply with quote

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
View user's profile Send private message
sumitmalik29
Warnings : 1

New User


Joined: 10 Feb 2008
Posts: 19
Location: bhuneswar

PostPosted: Sat Jul 11, 2015 6:41 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Jul 11, 2015 7:52 pm
Reply with quote

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
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Mon Jul 13, 2015 5:40 pm
Reply with quote

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
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

 


Similar Topics
Topic Forum Replies
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Substring number between 2 characters... DFSORT/ICETOOL 2
No new posts Generate random number from range of ... COBOL Programming 3
No new posts Increase the number of columns in the... IBM Tools 3
No new posts Cobol program with sequence number ra... COBOL Programming 5
Search our Forums:

Back to Top