View previous topic :: View next topic
|
Author |
Message |
nirmal.poikaikumaran
New User
Joined: 29 Nov 2005 Posts: 66 Location: Bangalore
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Create an empty +1 before the copy. |
|
Back to top |
|
|
nirmal.poikaikumaran
New User
Joined: 29 Nov 2005 Posts: 66 Location: Bangalore
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
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 |
|
|
nirmal.poikaikumaran
New User
Joined: 29 Nov 2005 Posts: 66 Location: Bangalore
|
|
|
|
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 |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
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 |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
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 |
|
|
nirmal.poikaikumaran
New User
Joined: 29 Nov 2005 Posts: 66 Location: Bangalore
|
|
|
|
No REXX, the solution which you give are feasible for application programmer? |
|
Back to top |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
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. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
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 ! |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
mmm...can I've a live demo please, if camera is not there, after all I'm also putting up in Mumbai these days! |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
|