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

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


IBM Mainframe Forums -> JCL & VSAM
Post new topic   This topic is locked: you cannot edit posts or make replies.
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
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

Moderator Emeritus


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

PostPosted: Thu Mar 25, 2010 9:32 pm
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
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

Global Moderator


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

PostPosted: Thu Mar 25, 2010 9:46 pm
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
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: 400
Location: Mumbai

PostPosted: Thu Mar 25, 2010 10:42 pm
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: 400
Location: Mumbai

PostPosted: Thu Mar 25, 2010 11:00 pm
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
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: 400
Location: Mumbai

PostPosted: Thu Mar 25, 2010 11:43 pm
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: 8700
Location: Dubuque, Iowa, USA

PostPosted: Thu Mar 25, 2010 11:50 pm
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

Superior Member


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

PostPosted: Fri Mar 26, 2010 5:22 pm
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: 8796
Location: Welsh Wales

PostPosted: Fri Mar 26, 2010 5:57 pm
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. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts sort to find out the char which repea... Mainframe Interview Questions 10
No new posts Compare 2 alphabets in a REXX and fin... CLIST & REXX 2
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Find the occurrence of Key Field (Par... DFSORT/ICETOOL 6
Search our Forums:

Back to Top