Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

USS script : how to test that a MVS Dataset exists ?

103 views
Skip to first unread message

0000025379c10d0...@listserv.ua.edu

unread,
Jul 2, 2019, 9:39:22 AM7/2/19
to
Hello,I would like to "test" if a MVS Dataset exist (is catalogued) during the /etc/rc script.
As far as I know, since /etc/rc script run during USS initialisation, TSO services are not yet available. So I cannot use the "tso" Unix command to issue a LISTCAT.
Actualy my need is to perform a mount command in this process. But I do not want to return Error messages, if the HFS/ZFS doesn't exist. That's why I need to test that the dataset is catalogued/exist before calling the Mount service.

Do you have any idea ?
Regards,Laurent

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to list...@listserv.ua.edu with the message: INFO IBM-MAIN

Lionel B Dyck

unread,
Jul 2, 2019, 9:43:45 AM7/2/19
to
You could use the cat "//'zos.dsname'" and it will either work on you will get a error message:

/u/user/cat "//'USER.TEST'"
cat: //'USER.TEST': EDC5049I The specified file name could not be located.


Lionel B. Dyck <sdg><
Website: http://www.lbdsoftware.com

"Worry more about your character than your reputation. Character is what you are, reputation merely what others think you are." - John Wooden

Kirk Wolf

unread,
Jul 2, 2019, 10:21:27 AM7/2/19
to
Hi Lionel,

Did you try this with an existing zFS cluster? I get the same error:

> cat //'dovetail.usrloc.zfs'


cat: //dovetail.usrloc.zfs: EDC5049I The specified file name could not be
located.

FWIW, you can use the Co:Z "catsearch" shell command, which is a shell
command interface to IGGCSI00, etc. (free to use under our Community
License).

For example:

> count=$(catsearch dovetail.usrloc.zfs | wc -l )
> echo $count
1

Back to the original problem - why not use "mount" and redirect stderr
somewhere to a temp file that your script can look at. There might be
errors mounting other than the data set not existing.

Kirk Wolf
http://dovetail.com

PS> There seems to be a legitimate problem with the error returned by
"cat". If I try to read the zfs using the Co:Z "fromdsn" shell command
(which opens and reads using fopen() / fread():

> fromdsn //dovetail.usrloc.zfs
fromdsn(DOVETAIL.USRLOC.ZFS)[E]: DatasetHandler: Error in
fopen(//'DOVETAIL.USRLOC.ZFS', rb,type=record,noseek,recfm=*) - EDC5041I An
error was detected at the system level when opening a file.
(errno2=0xC00A0022)

This is an expected error, since reading VSAM with fread() is not supported
by z/OS for linear data sets.
But doing this on a non-existing file results in:

>fromdsn foo.bar
fromdsn(FOO.BAR)[E]: DatasetHandler: Error in fopen(//'FOO.BAR',
rb,type=record,noseek,recfm=*) - EDC5049I The specified file name could not
be located. (errno2=0xC00B0641)

If you look up the errno2 (reason codes) with bpxmtext, these look right.
You can get cat to print out the errno2 with:

>export _EDC_ADD_ERRNO2=1
/u/vendor/kirk>/bin/cat //'DOVETAIL.USRLOC.ZFS'


cat: //DOVETAIL.USRLOC.ZFS: EDC5049I The specified file name could not be
located. (errno2=0xC00B0641)

>bpxmtext c00b0641

JrEdc1opsElocate01: The filename argument passed to fopen() or freopen()
specified dsname syntax. The mode argument specified read. Allocation of a
ddname for the dsname was attempted, but SVC 99 failed with error code
0x1708.
The data set name could not be located. You cannot use read mode for a data
set that does not exist.

Action: Correct the application.

Source: edc1opst.c

That's just weird.

Laurent Grisel

unread,
Jul 2, 2019, 10:23:14 AM7/2/19
to
Hello Lionel !I tried with an actual HFS, and I get this from the command:
> cat //\'SYS2.IMS04.HFS.ROOTIMS.V14\'cat: //'SYS2.IMS04.HFS.ROOTIMS.V14': EDC5092I An I/O abend was trapped.

Ok, but I get also this message in syslog:IEC143I 213-8C,IFG0194D,WSYGRIS,STEP1,SYS00008,E61E,ZPS10G,SYS2.IMS04.HFS.ROOTIMS.V14

I would like to receive no message at all during this "test". I worry that my coworkers will search for an error, where there is none.

Regards,
Laurent

Lionel B Dyck

unread,
Jul 2, 2019, 10:24:23 AM7/2/19
to
I only tried it with an existing z/OS data set that was sequential and thus would work with cat. It wouldn't work with a non-sequential data set and I should have mentioned that.

Lionel B Dyck

unread,
Jul 2, 2019, 10:25:53 AM7/2/19
to
Laurent - you've exhausted what I know - hopefully someone else can provide you with the info that you need.


Lionel B. Dyck <sdg><
Website: http://www.lbdsoftware.com

"Worry more about your character than your reputation. Character is what you are, reputation merely what others think you are." - John Wooden

-----Original Message-----
From: IBM Mainframe Discussion List <IBM-...@LISTSERV.UA.EDU> On Behalf Of Laurent Grisel
Sent: Tuesday, July 2, 2019 9:23 AM
To: IBM-...@LISTSERV.UA.EDU

Laurent Grisel

unread,
Jul 2, 2019, 10:38:37 AM7/2/19
to
Lionel, many thanks to have tried to help me.
If nobody has an idea, I will need to open an RFE to IBM to extend the "if test -e" command to MVS datasets. :-(

Laurent Grisel

unread,
Jul 2, 2019, 11:50:14 AM7/2/19
to
Hello Kirk !
there are a lot of informations in your update. Thanks.
First, about the suggestion to use the mount command and parse the output:the problem is that an error message is issued at Syslog/Console at the same time. I would like to avoid that. I wish to test if the FS Dataset exists, but have no message if it doesn't exist (it may be normal in some case).
BPXF274I FILE SYSTEM SYS3.IMS04.HFS.ROOTIMS.V14 FAILED TO MOUNT. RETURN CODE = 00000081, REASON CODE = EF096055

Now about the catsearch tool:
My shop will accept to rely on a tool that is not offcialy supported by a known editor.

And about the cat command, I am not sure this the problem, but don't forget to escape the "slash" with a backslash on the shell prompt:
cat //\'SYS2.IMS04.HFS.ROOTIMS.V14\'

Regards.Laurent

Paul Gilmartin

unread,
Jul 2, 2019, 11:52:30 AM7/2/19
to
On Tue, 2 Jul 2019 14:38:07 +0000, Laurent Grisel wrote:

>Lionel, many thanks to have tried to help me.
>If nobody has an idea, I will need to open an RFE to IBM to extend the "if test -e" command to MVS datasets. :-(
>
NVFL.

What does BPXWDYN do if you try to allocate a HFS? A zFS? (You'd need a wrapper Rexx.)

> Le mardi 2 juillet 2019 à 16:25:54 UTC+2, Lionel B Dyck a écrit :
>
> Laurent - you've exhausted what I know - hopefully someone else can provide you with the info that you need.
>Website: http://www.lbdsoftware.com
>
>-----Original Message-----
>From: Laurent Grisel
>Sent: Tuesday, July 2, 2019 9:23 AM
>
> Hello Lionel !I tried with an actual HFS, and I get this from the command:
>> cat //\'SYS2.IMS04.HFS.ROOTIMS.V14\'cat: //'SYS2.IMS04.HFS.ROOTIMS.V14': EDC5092I An I/O abend was trapped.
>
>Ok, but I get also this message in syslog:IEC143I 213-8C,IFG0194D,WSYGRIS,STEP1,SYS00008,E61E,ZPS10G,SYS2.IMS04.HFS.ROOTIMS.V14

-- gil

Laurent Grisel

unread,
Jul 4, 2019, 9:10:39 AM7/4/19
to
Hello Paul,many thanks for your suggestion to use bpxwdyn. It works fine, even into the /etc/rc script at IPL.It solved me problem, since I receive no message if the dataset doesn't exist.

Regards,Laurent

Paul Gilmartin

unread,
Jul 4, 2019, 12:59:28 PM7/4/19
to
On Thu, 4 Jul 2019 13:10:21 +0000, Laurent Grisel wrote:

>Hello Paul,many thanks for your suggestion to use bpxwdyn. It works fine, even into the /etc/rc script at IPL.It solved me problem, since I receive no message if the dataset doesn't exist.
>
Pas de quoi.

I'm curious: Did you need to write a Rexx wrapper or were you already coding Rexx?

Note that messages are saved in stem S99MSG. (by default, I believe), available for
more detailed analysis.

If you invoke a Rexx wrapper with _BPX_SHAREAS=NO, any allocations it performs
are automatically freed on exit.
0 new messages