View previous topic :: View next topic
|
Author |
Message |
chanti
New User
Joined: 22 Nov 2008 Posts: 30 Location: hyderabad
|
|
|
|
How to check whether a particular member is present in a PDS using any utility or any way can we do it in a JCL
I know it can be done in REXX but searching for a way in a JCL as i have a requirement as shown below
COPY01 EXEC PGM=IEBGENER
SYSPRINT DD SYSOUT=*
SYSOUT DD SYSOUT=*
SYSIN DD DUMMY
SYSUT1 DD DSN=XXX.YYY(M1),DISP=SHR
DD DSN=XXX.YYY(M2),DISP=SHR
SYSUT2 DD DSN=XXX.ZZZZ(YYYY),DISP=SHR
the problem is M2 isn't being Created in the above Step, hence this step(copy01) is failing and the sysut2 isn't created
Looking for help on this
Thanks,
Chanti. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
M2 does not exist in pds XXX.YYY?
then why have you included it in SYSUT1? |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Already discussed
Please check here |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
normally, one insures that dataset names provided on (input) dd statements
are of datasets that exist.
the utility used to determine if a dataset exists,
should have been the utility to generate the jcl for your iebgener step.
why don't you explain why you have a dd statement for a non-existing file?
and the thread referenced by Pandora's Box
is just that.
using IEHLIST and parsing with sort could provide the answers,
but than again,
why a dsn that does not exist? |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Or there could be some Psychic guy who is deleting your member purposely??? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
If you explain what you are tryijng to accomplish (rather than how you have already tried to implement), someone may have a suggestion. |
|
Back to top |
|
|
chanti
New User
Joined: 22 Nov 2008 Posts: 30 Location: hyderabad
|
|
|
|
Actually M2 is created in the above step, if the program doesn't do well M2 isn't being created
As i cant control the program to create M2, i need to handle below in the JCL
I want the IEBGENER step to be run regardless whether M2 is created or not
Thanks,
Chanti. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Quote: |
Actually M2 is created in the above step, if the program doesn't do well M2 isn't being created
|
What does program doesn't do well mean?
a.Program doesnt execute and fails due to some criteria
b.Program doesnt execute as expected by you?
If you are very sure the quoted statement is correct check with the people in your team who knows better idea of the program which creates M2 and try to understand when it creates a member and when it does not
and also try to understand the need of having the IEBGENER step after that
Try to pass different return codes when M2 is created and when it is not and with that conditional return code execute your IEBGENER step |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Run your copy to copy M! only. Next step do something to check if M2 exists (rexx and set return code?). 3rd step do,or not do depending on condition codes, second copy. Or check first and then either do your IEBGENER as posted or a different gener step to copy only M1. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Then you need a different approach.
One alternative might be to have an "empty" M2 member and this is overwritten with data when appropriate. The M2 member would be emptied just before it might be created (depending on how the run processes).
This way the member would always exist and there would be no jcl error. . . |
|
Back to top |
|
|
chanti
New User
Joined: 22 Nov 2008 Posts: 30 Location: hyderabad
|
|
|
|
Creation of M2 isn't under our control...
Thanks all for your valuable suggestions..
For me, Dick Scherrer idea of creating an empty member would be good..
i'm still looking for better solution, if found will keep you posted
Thanks,
Chanti |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
how about telling us what you need to do, (description of requirements/resources/etc...)
not how you have decided to do it. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Dick you stole words from my fingers :-D
I could see your typing speed indeed :-P |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Quote: |
If you explain what you are trying to accomplish (rather than how you have already tried to implement), someone may have a suggestion. |
Or from this earlier reply. . . To which TS did post a reply.
d |
|
Back to top |
|
|
chanti
New User
Joined: 22 Nov 2008 Posts: 30 Location: hyderabad
|
|
|
|
as i already quoted
"I want the IEBGENER step to be run regardless whether M2 is created or not"
Thanks,
Chanti |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
the only way to determine if M2 exists or not is to access the PDS Directory.
to do so,
run some utility program (IEHLIST) to print the directory,
followed by something (SORT) to parse the listing and generate an appropriate rc
or
run a rexx step to generate the RC
you can not mod to the member to create it if it is not there with the DISP parms
as you can with a QSAM file.
the decision of which method to used is based on
whether or not
you want an 'empty' M2?
once you have answered that question (empty M2)
you can follow Nic's advice here |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
chanti wrote: |
Actually M2 is created in the above step, if the program doesn't do well M2 isn't being created. |
"if the program doesn't do well" then maybe it has a non-zero return code.
Did you check that ? |
|
Back to top |
|
|
|