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 check whether a particular member is present in a PDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
chanti

New User


Joined: 22 Nov 2008
Posts: 29
Location: hyderabad

PostPosted: Fri May 18, 2012 4:39 pm    Post subject: How to check whether a particular member is present in a PDS
Reply with quote

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

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri May 18, 2012 4:53 pm    Post subject:
Reply with quote

M2 does not exist in pds XXX.YYY?

then why have you included it in SYSUT1?
Back to top
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri May 18, 2012 5:11 pm    Post subject:
Reply with quote

Already discussed
Please check here
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri May 18, 2012 5:16 pm    Post subject:
Reply with quote

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

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri May 18, 2012 5:21 pm    Post subject:
Reply with quote

Or there could be some Psychic guy who is deleting your member purposely??? icon_lol.gif icon_lol.gif
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: Fri May 18, 2012 6:57 pm    Post subject:
Reply with quote

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

New User


Joined: 22 Nov 2008
Posts: 29
Location: hyderabad

PostPosted: Fri May 18, 2012 7:49 pm    Post subject: Reply to: How to check whether a particular member is presen
Reply with quote

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

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri May 18, 2012 7:59 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 10 May 2007
Posts: 1713
Location: UK

PostPosted: Fri May 18, 2012 7:59 pm    Post subject:
Reply with quote

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

Site Director


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

PostPosted: Fri May 18, 2012 8:00 pm    Post subject: Reply to: How to check whether a particular member is presen
Reply with quote

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

New User


Joined: 22 Nov 2008
Posts: 29
Location: hyderabad

PostPosted: Fri May 18, 2012 8:08 pm    Post subject: Reply to: How to check whether a particular member is presen
Reply with quote

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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri May 18, 2012 8:21 pm    Post subject:
Reply with quote

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

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Fri May 18, 2012 8:22 pm    Post subject:
Reply with quote

Dick you stole words from my fingers :-D

I could see your typing speed indeed :-P
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: Fri May 18, 2012 8:24 pm    Post subject:
Reply with quote

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

New User


Joined: 22 Nov 2008
Posts: 29
Location: hyderabad

PostPosted: Fri May 18, 2012 8:32 pm    Post subject: Reply to: How to check whether a particular member is presen
Reply with quote

as i already quoted

"I want the IEBGENER step to be run regardless whether M2 is created or not"

Thanks,
Chanti
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri May 18, 2012 8:52 pm    Post subject:
Reply with quote

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

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Sat May 19, 2012 3:27 am    Post subject: Re: Reply to: How to check whether a particular member is pr
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    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 What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts File Stauts 92 with member of PDS sandip_mainframe COBOL Programming 4 Fri Jun 10, 2016 12:06 pm
No new posts Syntax to check the first 4 digits of... kshirabdhi DFSORT/ICETOOL 10 Tue May 03, 2016 12:21 pm
No new posts Check special resource availability w... pinimo JCL & VSAM 8 Fri Apr 15, 2016 8:18 pm


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