Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Access file which has DSNTYPE=LIBRARY

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

Active User


Joined: 27 Feb 2008
Posts: 106
Location: india

PostPosted: Fri Jun 21, 2019 4:09 pm    Post subject: Access file which has DSNTYPE=LIBRARY
Reply with quote

Hi,
I have a PDSE file which has DSNTYPE=LIBRARY.

While I process this thru JCL thru IEBGENER, it fails with S002.
Here is my JCL:
//TEST1 EXEC PGM=IEBGENER
//SYSPRINT DD DUMMY
//SYSUT1 DD DISP=SHR,DSN=NE.HSE.EMP500
//SYSUT2 DD SYSOUT=(,),OUTPUT=*
//SYSIN DD DUMMY

If I remove this IEBGENER step, then it executes successfully in rest of the steps.
Not sure whether IEBGENER supports this file ?
Thanks
Back to top
View user's profile Send private message

enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10626
Location: italy

PostPosted: Fri Jun 21, 2019 4:40 pm    Post subject: Reply to: Access file which has DSNTYPE=LIBRARY
Reply with quote

what should be the expected result ?
Back to top
View user's profile Send private message
maxsubrat

Active User


Joined: 27 Feb 2008
Posts: 106
Location: india

PostPosted: Fri Jun 21, 2019 5:00 pm    Post subject: Reply to: Access file which has DSNTYPE=LIBRARY
Reply with quote

The JCL has 5 steps which calls the same proc each time.
The proc functionality is to check the dataset opens successfully and check the members exist or not.
So there is 3-4 steps are there in the proc to check the datasets which is passing from JCL.

sample jcl: only the step1 has the dsntype=library, all other steps has PDS.

//STEP1 EXEC CHKDPDS,DSN=NE.HSE.EMP500
//STEP2 EXEC CHKDPDS,DSN=NE.HSE.EMP501
//STEP3 EXEC CHKDPDS,DSN=NE.HSE.EMP502
//STEP4 EXEC CHKDPDS,DSN=NE.HSE.EMP503
//STEP5 EXEC CHKDPDS,DSN=NE.HSE.EMP504

PROC:
//TEST1 EXEC PGM=IEBGENER
//SYSPRINT DD DUMMY
//SYSUT1 DD DISP=SHR,DSN=NE.HSE.EMP500
//SYSUT2 DD SYSOUT=(,),OUTPUT=*
//SYSIN DD DUMMY

This is the 1st step in the proc.
there are few more steps also to check the members are exist in the datasets or not.
But the job fails in this 1st step for the file NE.HSE.EMP500.
all other jcl steps executes successfully.
So the step1 in the JCL also should run successfully like other steps. But it is throwing error with S002.

Thanks
Back to top
View user's profile Send private message
enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10626
Location: italy

PostPosted: Fri Jun 21, 2019 5:09 pm    Post subject: Reply to: Access file which has DSNTYPE=LIBRARY
Reply with quote

Quote:
Not sure whether IEBGENER supports this file ?



IEBGENER is designed to deal with DSORG PS datasets or members of a partitioned dataset

using for something different will result in unpredictable behaviour

until now you have been lucky

find a different approach.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 565
Location: Maryland

PostPosted: Fri Jun 21, 2019 6:06 pm    Post subject: Re: Access file which has DSNTYPE=LIBRARY
Reply with quote

maxsubrat wrote:
Hi,
I have a PDSE file which has DSNTYPE=LIBRARY.

While I process this thru JCL thru IEBGENER, it fails with S002.
Here is my JCL:
//TEST1 EXEC PGM=IEBGENER
//SYSPRINT DD DUMMY
//SYSUT1 DD DISP=SHR,DSN=NE.HSE.EMP500
//SYSUT2 DD SYSOUT=(,),OUTPUT=*
//SYSIN DD DUMMY

This has nothing to do with DSNTYPE=LIBRARY or not.

It was a stupid idea (1) to use //SYSPRINT DD DUMMY while having absolutely no idea about the used tools, and (2) to have read no documentation, or no explained examples before doing something with your own hands.

IEBGENER is not supposed to work with DSORG=PO datasets. Period.

This code, when translated to non-mainframe language, is equivalent to hammering screws using a huge hammer... As well as to make a big iron swimming in a water pool.
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 317
Location: Denmark

PostPosted: Fri Jun 21, 2019 7:40 pm    Post subject:
Reply with quote

As stated by others, you cannot use IEBGENER to check for an empty PDS/E.
You can use IEHLIST or various freeware tools to list directories and post-process the output to check for members or not.
One IBM alternative to IEHLIST could be the TSO LISTPDS command in batch.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 753
Location: The Universe

PostPosted: Fri Jun 21, 2019 7:48 pm    Post subject:
Reply with quote

Willy Jensen wrote:
As stated by others, you cannot use IEBGENER to check for an empty PDS/E.
You can use IEHLIST or various freeware tools to list directories and post-process the output to check for members or not.
One IBM alternative to IEHLIST could be the TSO LISTPDS command in batch.
There is no IBM supplied line mode LISTPDS command
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 753
Location: The Universe

PostPosted: Fri Jun 21, 2019 8:06 pm    Post subject:
Reply with quote

The other question I have is what is the real goal here? Ignoring the issue about DSNTYPE=LIBRARY, I can't see the example JCL as producing any useful output even for old style PDS data sets.

There is no such thing as an "empty" PDS. There are PDSs with no members, but a PDS (or even a DSNTYPE=LIBRARY PDS) with no members is not "empty." There is always a directory with a pseudo member entry that indicates the end of the directory.

I have to go now. There is a little more research I'd like to do but I can't do it right now,
Back to top
View user's profile Send private message
maxsubrat

Active User


Joined: 27 Feb 2008
Posts: 106
Location: india

PostPosted: Fri Jun 21, 2019 8:25 pm    Post subject: Reply to: Access file which has DSNTYPE=LIBRARY
Reply with quote

Thanks for all the valuable info.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 565
Location: Maryland

PostPosted: Fri Jun 21, 2019 9:12 pm    Post subject:
Reply with quote

It makes sense for TS sometimes to read at least something by himself before trying to ask others.

There are plenty of options in the world of mainframes...
One of the simplest is like this:
Quote:
Return Codes

z/OS DFSMSdfp Utilities
SC23-6864-00

IEBPTPCH returns a code in register 15 to indicate the results of program execution.

The return codes and their meanings are:

Codes --- Meaning

00 (X'00') --- Successful completion.

04 (X'04') --- Either a physical sequential data set is empty or a partitioned data set has no members.

08 (X'08') --- A member specified for printing or punching does not exist in the input data set and processing will continue with the next member, or a DBCS error was encountered.

12 (X'0C') --- An unrecoverable error occurred, a user routine passed a return code of 12 to IEBPTPCH and the utility is ended, or a DBCS error was encountered.

16 (X'10') --- A user routine passed a return code of 16 to IEBPTPCH. The utility is ended.
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 317
Location: Denmark

PostPosted: Fri Jun 21, 2019 10:58 pm    Post subject:
Reply with quote

@steve-myers
Quote:
There is no IBM supplied line mode LISTPDS command

Quite right, I was thinking of the LISTDS dsname MEMBERS command.
Blame it on age creeping in.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 753
Location: The Universe

PostPosted: Sat Jun 22, 2019 4:11 am    Post subject:
Reply with quote

sergeyken wrote:

Quote:
Return Codes

z/OS DFSMSdfp Utilities
SC23-6864-00

IEBPTPCH returns a code in register 15 to indicate the results of program execution.

The return codes and their meanings are:

Codes --- Meaning

00 (X'00') --- Successful completion.

04 (X'04') --- Either a physical sequential data set is empty or a partitioned data set has no members.

08 (X'08') --- A member specified for printing or punching does not exist in the input data set and processing will continue with the next member, or a DBCS error was encountered.

12 (X'0C') --- An unrecoverable error occurred, a user routine passed a return code of 12 to IEBPTPCH and the utility is ended, or a DBCS error was encountered.

16 (X'10') --- A user routine passed a return code of 16 to IEBPTPCH. The utility is ended.
Yes, and IEBPTPCH also issues the technically incorrect message (for a PDS) with RC 4 -

IEB417I DATA SET EMPTY, RETURN CODE IS 4
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 How to place name of the file where t... danielgp89 SYNCSORT 18 Thu Oct 17, 2019 12:55 am
No new posts Need help in parsing record in VBA file guptae DFSORT/ICETOOL 4 Fri Oct 11, 2019 2:31 pm
No new posts What 'EF' in the CAFC command REGION,... vrkratheesh CICS 2 Wed Sep 18, 2019 4:52 pm
No new posts Can we pass the value of Symbolic par... Poha Eater JCL & VSAM 5 Thu Sep 05, 2019 2:21 pm
No new posts Search the strings present in ps file... Bhuvana Narasimhan All Other Mainframe Topics 8 Thu Aug 22, 2019 8:20 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us