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

Rexx to get details of a Tape Dataset

1,872 views
Skip to first unread message

Ponnappan, Binoj K

unread,
Jun 4, 2010, 2:59:46 PM6/4/10
to
Hi,

Is there any way to find the details of a Tape Dataset, precisely the
LRECL of the Tape file.

I tried using the LISTDSI but it is returning nothing.

Can someone please help me with this.

Thanks and Regards
__Binoj P__

----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

Don Imbriale

unread,
Jun 4, 2010, 3:09:10 PM6/4/10
to
The REXX Reference manual description of LISTDSI should provide you the
answer.

- Don Imbriale

On Fri, Jun 4, 2010 at 2:57 PM, Ponnappan, Binoj K
<binoj.p...@eds.com>wrote:

Paul Gilmartin

unread,
Jun 4, 2010, 4:18:15 PM6/4/10
to
On 06/04/10 13:07, Don Imbriale wrote:

> The REXX Reference manual description of LISTDSI should provide you the
> answer.
>
>

Gee, you'd better submit an RCF:

Linkname:
LISTDSI
URL:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ikj4a380/4.4.2

Title: z/OS V1R11.0 TSO/E REXX
Reference
Document Number: SA22-7790-08

4.4.2 "z/OS V1R11.0 TSO/E REXX Reference"
You can use LISTDSI to obtain information about a data set that
is
available on DASD. LISTDSI does not directly support data that is
on
tape.

At the very least, TFM should explain what it means by "directly", or
how to obtain the information indirectly. (You could also point out their
misuse of a singular verb with "data".)

> On Fri, Jun 4, 2010 at 2:57 PM, Ponnappan, Binoj K wrote:
>
> Is there any way to find the details of a Tape Dataset, ...

-- gil

Bob Bridges

unread,
Jun 4, 2010, 4:23:36 PM6/4/10
to
No, if LISTDSI is returning nothing I suppose it's because it's an
uncatalogued tape, probably coming from off-site. For that, if the sender
didn't give you the proper information, you need to read the tape label.
REXXers who have done this more recently than I have please correct the
following as necessary:

A dataset label has all the information on it you need to read the dataset.
On tapes, the labels are written not in a volume catalogue (since a tape has
none) but as second dataset, or actually a first dataset since it precedes
the data you want to read. So a tape with multiple datasets on it really
has twice as many as you think: a label, then its dataset, then another
label and another dataset, and so on. When a tape dataset is catalogued,
MVS normally handles all this for you, and even when a tape comes from
off-site I think normally MVS will read the label for you. But if for some
reason you want or need an advance peek at the tape's DCB information, you
use LABEL=(1,BLP) in your JCL. The BLP part tells MVS to Bypass Label
Processing, which causes it to read a dataset as TWO datasets, you see. The
'1' means to read the first dataset, the label. Check section 12.34 of the
JCL reference
(http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/iea1b640) for
more detail on the LABEL parm.

Note: MVS normally secures datasets by their name, and when you bypass the
label the OS never sees the DSN. Therefore BLP lets you read not just
off-site tapes but any catalogued tape dataset as well, so if you're at a
well-run installation you probably don't have the authority to use BLP
unless you're an operator or one of a few privileged system programmers. If
you're an applications programmer, you'll either have to get temporary
authority to use BLP or to get someone down in Operations to read the label
for you.

---
Bob Bridges, rhb...@attglobal.net, cell 336 382-7313

/* Good teaching is one-fourth preparation and three-fourths good theatre.
-Gail Godwin */

Lizette Koehler

unread,
Jun 4, 2010, 4:40:33 PM6/4/10
to
What tape management system do you have? You can probably pull the
information from it or you might have to get the Tape mounted and opened in
you REXX and then find the information in the control blocks.

Lizette

Paul Gilmartin

unread,
Jun 4, 2010, 4:47:18 PM6/4/10
to
On 06/04/10 14:22, Bob Bridges wrote:
> A dataset label has all the information on it you need to read the dataset.
> On tapes, the labels are written not in a volume catalogue (since a tape has
> none) but as second dataset, or actually a first dataset since it precedes
> the data you want to read. So a tape with multiple datasets on it really
> has twice as many as you think: a label, then its dataset, then another
> label and another dataset, and so on.
Three times. There are trailer labels, also.

> When a tape dataset is catalogued,
> MVS normally handles all this for you, and even when a tape comes from
> off-site I think normally MVS will read the label for you.

As you stated earlier, the catalog has little to do with it. I don't even
know whether the catalog indicates whether the tape has labels.
(Some tapes have no labels.)

> But if for some
> reason you want or need an advance peek at the tape's DCB information, you
> use LABEL=(1,BLP) in your JCL. The BLP part tells MVS to Bypass Label
> Processing, which causes it to read a dataset as TWO datasets, you see.

THREE. Or, OPEN the data set and fetch the information from fields in
the DCB.
(Rexx won't do this; assembler will. As a desperation measure, IEBGENER the
data set to a cataloged DASD data set, and use LISTDSI on that.)


> The
> '1' means to read the first dataset, the label. Check section 12.34 of the
> JCL reference
> (http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/iea1b640) for
> more detail on the LABEL parm.
>

> so if you're at a
> well-run installation you probably don't have the authority to use BLP
> unless you're an operator or one of a few privileged system programmers.

-- gil

Paul Gilmartin

unread,
Jun 4, 2010, 4:53:39 PM6/4/10
to
On 06/04/10 14:39, Lizette Koehler wrote:
> What tape management system do you have? You can probably pull the
> information from it or you might have to get the Tape mounted and opened in
> you REXX and then find the information in the control blocks.
>
>
DCB? TIOT? JFCB? Other? Does Rexx provide any facility to access
these? Sigh. Start from the CVT ...

-- gil

Mickey

unread,
Jun 4, 2010, 5:08:10 PM6/4/10
to
It could also mean that the file is new, tape is mounted, the allocation
issued, but the file has not yet been closed.

--------------------------------------------------
From: "Bob Bridges" <rhb...@ATTGLOBAL.NET>
Sent: Friday, June 04, 2010 4:22 PM

Mickey

unread,
Jun 4, 2010, 6:04:47 PM6/4/10
to
Storage command, and some data conversions, and you got it all. I just went
through doing this.

Mickey

--------------------------------------------------
From: "Paul Gilmartin" <PaulGB...@AIM.COM>
Sent: Friday, June 04, 2010 4:52 PM


To: <TSO-...@VM.MARIST.EDU>
Subject: Re: [TSO-REXX] Rexx to get details of a Tape Dataset

> On 06/04/10 14:39, Lizette Koehler wrote:

Stephen Piccone

unread,
Jun 4, 2010, 8:01:16 PM6/4/10
to
Hi Gil,

If it is a standard-label (SL) tape, you should probably use the BLP
parm as Bob suggested to copy the label to a dataset:

> use LABEL=(1,BLP) in your JCL. The BLP part tells MVS to
Bypass Label
> Processing, which causes it to read a dataset as TWO
datasets, you see.
> The '1' means to read the first dataset, the label.

The label consists of 3 records:

VOL1 ... <--- Internal volser is listed here.
HDR1 ...
HDR2 ... < ---The file information (BLKSIZE,
LRECL & RECFM) will be listed here.

I think they're listed in order BLKSIZE (5), LRECL (5), RECFM (1) with
no spaces between. If RECFM is F, then the BLKSIZE will be divisible by the
LRECL. I believe the label file is LRECL=80.

In normal standard-label processing each actual data file is sandwiched
between a header label file (HDR1 & HDR2) and a trailer label file (TRL1 &
TRL2). Both contain the same information. Only the first label on the tape
will contain a VOL1 record.

If there is no HDR2 record then the creator used non-labeled (NL)
processing and just forwarded past the label before writing.

I hope this info helps.


Steve

Robert Zenuk

unread,
Jun 4, 2010, 9:16:34 PM6/4/10
to
Here is a sample REXX EXEC to list a DD. It chases the TIOT and gets the
DCB information from the JFCB. It uses Gilbert Saint-flour's SWAREQ
routine to get the JFCB. Like any DD/DSN, the DCB information is not populated
until the DD is opened. This sample uses EXECIO to OPEN/CLOSE a supplied DD
provided as a parm. The only DCB information I included was the LRECL,
but it is all there in the JFCB if someone wanted to enhance this.

Here is the link to the JFCB map for z/OS 1.10 to find the offsets:

_http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/MVS10DA4/120.1.1
?SHELF=IEA2BK91&DT=20081112100131&CASE_
(http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/MVS10DA4/120.1.1?SHELF=IEA2BK91&DT=20081112100131&CA
SE) =

You would add your desired fields after line 14 and update line 17 to
display them.

Here is the code:

EDIT ROB.EXEC(TIOTDD) - 01.01 Member TIOTDD saved
Command ===> Scroll ===>
CSR
****** ***************************** Top of Data
******************************
000001 /* rexx - walk the tiot and retrieve the JFCB for a DD */

000002 arg anydd

000003 "EXECIO 0 DISKR" anydd "(OPEN"

000004 "EXECIO 0 DISKR" anydd "(FINIS"

000005 tiot = ptr(ptr(540)+12)

000006 numeric digits 10

000007 do i=1 to 999

000008 sva = stg(tiot+24+12,3)

000009 if sva = '000000'x then leave

000010 jfcb = swareq(sva)

000011 ddn = stg(tiot+24+4,8)

000012 dsn = stg(jfcb,44)

000013 vol = stg(jfcb+118,6)

000014 lrecl = c2d(stg(jfcb+104,2))

000015 if ddn = tapedd then

000016 do

000017 say left(ddn,8) left(vol,6) right(lrecl,5) left(dsn,44)

000018 leave

000019 end

000020 tiot = tiot + 20

000021 end

000022 exit 0

000023 ptr: return c2d(storage(d2x(arg(1)),4))

000024 stg: return storage(d2x(arg(1)),arg(2))

000025 swareq: procedure

000026 if right(c2x(arg(1)),1) \= 'F' Then

000027 return c2d(arg(1))+16

000028 sva = c2d(arg(1))

000029 tcb = ptr(540)

000030 jscb = ptr(tcb+180)

000031 qmpl = ptr(jscb+244)

000032 qmat = ptr(qmpl+24)

000033 do while sva>65536

000034 qmat = ptr(qmat+12)

000035 sva = sva - 65536

000036 end

000037 return ptr(qmat+sva+1)+16

****** **************************** Bottom of Data
****************************

Sample JCL to test it:

//jobcard...
//***************************************************************
//* TSO BATCH JOB *
//***************************************************************
//LOADTAPE EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD DUMMY
//SYSUT1 DD *
TEST1
TEST2
TEST3
TEST4
TEST5
//SYSUT2 DD DSN=ROB.TAPETEST,DISP=(,CATLG),UNIT=CTAPE,
// LABEL=(,SL)
//***************************************************************
//TAPEDCB EXEC PGM=IKJEFT01,PARM='TIOTDD TAPEDD'
//SYSEXEC DD DSN=ROB.EXEC,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD DUMMY
//TAPEDD DD DSN=*.LOADTAPE.SYSUT2,DISP=(OLD,DELETE)


Rob


In a message dated 6/4/2010 5:01:08 P.M. US Mountain Standard Time,

Bob Bridges

unread,
Jun 4, 2010, 11:29:24 PM6/4/10
to
Oh, yeah! I forgot about those. Boy, it's been a while since I had to read
an off-site tape.

---
Bob Bridges, rhb...@attglobal.net, cell 336 382-7313

/* Good teaching is one-fourth preparation and three-fourths good theatre.
-Gail Godwin */

-----Original Message-----
From: Paul Gilmartin
Sent: Friday, June 4, 2010 16:46

Three times. There are trailer labels, also.

--- On 06/04/10 14:22, Bob Bridges wrote:
> A dataset label has all the information on it you need to read the
> dataset. On tapes, the labels are written not in a volume catalogue
> (since a tape has none) but as second dataset, or actually a first dataset
> since it precedes the data you want to read. So a tape with multiple
> datasets on it really has twice as many as you think: a label, then its

> dataset, then another label and another dataset, and so on....

Pinnacle

unread,
Jun 5, 2010, 12:00:58 AM6/5/10
to
----- Original Message -----
From: "Ponnappan, Binoj K" <binoj.p...@EDS.COM>
Newsgroups: bit.listserv.tsorexx
Sent: Friday, June 04, 2010 2:59 PM
Subject: Rexx to get details of a Tape Dataset


> Hi,
>
> Is there any way to find the details of a Tape Dataset, precisely the
> LRECL of the Tape file.
>
> I tried using the LISTDSI but it is returning nothing.
>
> Can someone please help me with this.
>

What tape manglement system are you running? For CA-1, use TMSBINQ, for
RMM, use the RMM LD command.

Regards,
Tom Conley

0 new messages