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
 

 

How to find in JCL, whether a GDG has any generations?

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
nirmal.poikaikumaran

New User


Joined: 29 Nov 2005
Posts: 66
Location: Bangalore

PostPosted: Thu Mar 25, 2010 9:27 pm    Post subject: How to find in JCL, whether a GDG has any generations?
Reply with quote

Hi

I have a JCL SORT Step like this. When I try t ocompress the ABCD.DAILY & it does not have any generations, am gettign a JCL Error. How do i resolve it ?

Code:
//BACKUP   EXEC PGM=SORT                                 
//SORTIN   DD  DISP=SHR,DSN=ABCD.DAILY          GDG 7 generations   
//SORTOUT  DD  DISP=(,CATLG,DELETE),                     
//             DSN=ABCD.WEEKLY(+1),
//             DCB=(XXXXX,LRECL=130,RECFM=FB)
//SYSOUT   DD  SYSOUT=*                                   
//SYSIN    DD  *                                         
  SORT FIELDS=COPY                                       
/*                                                       


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

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Mar 25, 2010 9:32 pm    Post subject:
Reply with quote

Hello,

Create an empty +1 before the copy.
Back to top
View user's profile Send private message
nirmal.poikaikumaran

New User


Joined: 29 Nov 2005
Posts: 66
Location: Bangalore

PostPosted: Thu Mar 25, 2010 9:34 pm    Post subject:
Reply with quote

Oh sorry I forgot to say that every generation would trigger 10's of jobs of inventory processing, i cannot create a empty generation
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Mar 25, 2010 9:46 pm    Post subject: Reply to: How to find in JCL, whether a GDG has any generati
Reply with quote

When you run a LISTCAT against the GDG base you should get back a report of all of the associated generations for that base. The best thing I can think of off-hand would be to then count the number of lines like this:

NONVSAM ------- HLQ.G0001V00
...
NONVSAM ------- HQL.G0002V00
...

and set the return-code as you prefer based on count results.
Back to top
View user's profile Send private message
nirmal.poikaikumaran

New User


Joined: 29 Nov 2005
Posts: 66
Location: Bangalore

PostPosted: Thu Mar 25, 2010 10:16 pm    Post subject: Reply to: How to find in JCL, whether a GDG has any generati
Reply with quote

Hi Kevin,

I used a LISTCAT and got the SYSPRINT displaying

ASSOCIATIONS--------(NULL)

for a GDG which has no versions.

But how to find or count the SYSPRINT dataset ?
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Thu Mar 25, 2010 10:42 pm    Post subject:
Reply with quote

run listcat from Rexx and either outtrap() the results or allocate all the needed ddnames and run IDCAMS to do the listcat. I'm sure someone can also provide some means of examining the listcat with SORT and count operations using a referback to the SYSPRINT ddname. (personally that seems sort of silly to me, but I guess if you want to have everything in a single job stream with no external Rexx, that might be OK).
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Thu Mar 25, 2010 11:00 pm    Post subject:
Reply with quote

I might as well add that you can also run any program that does a catalog search. You can modify 'sys1.samplib(IGGCSIRX)' or use the freeware Rexx REALNAME( your.gdg(0) ) function (with site approval, of course).
Back to top
View user's profile Send private message
nirmal.poikaikumaran

New User


Joined: 29 Nov 2005
Posts: 66
Location: Bangalore

PostPosted: Thu Mar 25, 2010 11:13 pm    Post subject:
Reply with quote

No REXX, the solution which you give are feasible for application programmer?
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Thu Mar 25, 2010 11:43 pm    Post subject:
Reply with quote

Rexx is for "application programmers" so I don't know why there would be "no rexx" (thought that has been discussed to death here already and my blood pressure will cause my head to explode if we go through that again).

If it is a "no rexx" situation, you are stuck with SORT or writing COBOL, assembler, PL/I, basic, apl, perl, java, awk scripts, shell scripts, algol, snobol, clist, or anything else your "no rexx" shop will allow "application programmers" to use.

And before anyone starts talking about z/OS programmers who won't learn Rexx in hopes of seeing a video of my head exploding on YouTube, let me tell you I don't have a camera. icon_rolleyes.gif
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Mar 25, 2010 11:50 pm    Post subject:
Reply with quote

Quote:
And before anyone starts talking about z/OS programmers who won't learn Rexx in hopes of seeing a video of my head exploding on YouTube, let me tell you I don't have a camera. icon_rolleyes.gif
Dang! And I was SO looking forward to that video ! icon_biggrin.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


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

PostPosted: Fri Mar 26, 2010 5:22 pm    Post subject:
Reply with quote

mmm...can I've a live demo please, if camera is not there, after all I'm also putting up in Mumbai these days! icon_biggrin.gif
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Mar 26, 2010 5:57 pm    Post subject:
Reply with quote

As I'm in such a good mood, I'll do your work for you. Save you throwing your toys out of the pram when a REXX solution was offered but was unacceptable. But of course, had you have stated from the outset what was and was not acceptable then one of the senior members could have used his efforts for a more deserving post. Neither did you mention the implications of a dummy +1 GDS. We are IT people not psychics !!!

The solution is hardly rocket science, and has been discussed various times on the forum. There is a search button you know. Have you tried using it ?

Code:
//IDCAMS   EXEC PGM=IDCAMS                               
//SYSPRINT DD DSN=&&TEMP01,DISP=(,PASS),SPACE=(TRK,(1,1))
//SYSIN    DD *                                           
 LISTCAT ENT('XX.TEST.GDG01') GDG ALL                     
/*                                                       
//*                                                       
//EXTRACT  EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=&&TEMP01,DISP=SHR                       
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD *                                           
 OPTION    NULLOUT=RC4,VLSCMP                             
 SORT      FIELDS=COPY                                   
 INCLUDE   COND=(35,2,CH,EQ,C'.G',AND,41,3,CH,EQ,C'V00')


The code above will list the GDG base and any associated generations. The sort step picks up if any generations exist, by testing various places to find generally accepted GDS syntax and, if generations do exist will give RC=0. If no generations exist then it will give RC=4.

You will probably have to adjust the positions for where the test fields are located on your own, but if that's too much for you, please let one of us know and we'll do it for you.

Oh, I suppose I'd better add that you then run your real sort conditionally based on the RC from these steps, just in case you got confused with what to do next.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to find the first monday of the w... abdulrafi COBOL Programming 10 Fri Nov 25, 2016 3:24 pm
No new posts Find out a active PGM jpsager JCL & VSAM 10 Fri Oct 07, 2016 4:32 pm
No new posts How to find a CICS resource used in C... Arunkumar Chandrasekaran CICS 8 Thu Sep 29, 2016 1:45 pm
No new posts how to find clist's or view library Andrew Hsia CLIST & REXX 4 Tue Jun 28, 2016 6:07 pm
No new posts Compare each GDG Generations to other... Ayyappa1 JCL & VSAM 13 Tue Jun 28, 2016 1:48 pm


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