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

EXECIO with VB datasets

336 views
Skip to first unread message

Brenton, Ren

unread,
Feb 26, 2015, 11:15:20 AM2/26/15
to
I've tried researching this, but have had no luck. In REXX is there a way to interrogate the RWD of a VB dataset? I have a request to copy n number of BYTES, from a VB dataset to another dataset. Easily done in REXX with FB data, but with VB data, it is a little harder. The easiest thing, I've decided is to look at the RWD to determine the number of bytes in each record. However I cannot figure out how to get EXECIO to include the RDW data. I don't have to use EXECIO, I could write a quick little COBOL that can look at the RDW to do the work for me, but I prefer to do it all in REXX. PS: The dataset is BLKSIZE(27998) LRECL (27899) RECFM(V B).



Originally, I tried a straight allocation:



"ALLOC FI(INPUTDD) DA("myinput") SHR REUSE"

"EXECIO * DISKR INPUTDD (STEM X. FINIS"



Do i = 1 to 10

Say Substr(X.i,1,80)

End



No RDW.



So then I changed the ALLOCATION to:



"ALLOC FI(INPUTDD) DA("myinput") SHR REUSE",

"RECFM(V B)",

"LRECL(27899)",

"BLKSIZE(27998)"



No RDW



So then I added 4 bytes to the LRECL;



"ALLOC FI(INPUTDD) DA("myinput") SHR REUSE",

"RECFM(V B)",

"LRECL(27903)",

"BLKSIZE(27998)"



Still no RDW



Is there any way to accomplish this with REXX (with or without EXECIO)?



Thanks in advance.





Ren Brenton

IT- Applications Development Analyst III

MPD Excellence

Black Knight Financial Services

601 Riverside Ave.,

Jacksonville, FL 32204

__________________________________________________

O: 904.357.1448 | M: 404.438.3868 | F: 904.357.1807

ren.b...@bkfs.com || www.BKFS.com


The information contained in this message is proprietary and/or confidential. If you are not the intended recipient, please: (i) delete the message and all copies; (ii) do not disclose, distribute or use the message in any manner; and (iii) notify the sender immediately. In addition, please be aware that any message addressed to our domain is subject to archiving and review by persons other than the intended recipient. Thank you.

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

Lee, Bill

unread,
Feb 26, 2015, 11:29:19 AM2/26/15
to
What if you used RECFM=U? Would that work?
--
--------------------------------------------------
This e-mail transmission contains information intended only for the use of
the recipient(s) named above. Further, it contains information that may be
privileged and confidential. If you are not the intended recipient, you
are hereby notified that any dissemination, distribution, or copying of
this message (including any attachments) is strictly prohibited. If you
have received this e-mail in error, please notify the sender by reply
e-mail and then delete this message from your mail system. Thank you for
your compliance.

Ward Able, Grant

unread,
Feb 26, 2015, 11:31:51 AM2/26/15
to
Ren,
"LENGTH(X.i)" in your DO loop should give you the length of each record. You may need to fiddle a bit with the numeric format (C2X ?) to get it to be 2-bytes hex data prefixed by 2-bytes '0000'x, i.e. the record descriptor word.


Regards - Grant.
Telephone Internal: 201496 (London)
Telephone External: +44 (0)207 650 1496

If you don't have time to do it right, when will you have the time to do it over? - John Wooden
DTCC DISCLAIMER: This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error, please notify us immediately and delete the email and any attachments from your system. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email.

Don Imbriale

unread,
Feb 26, 2015, 11:32:55 AM2/26/15
to
Why do you need the RDW? If you just read a record you can use REXX
functions to determine the length of the record read.

On Thu, Feb 26, 2015 at 11:13 AM, Brenton, Ren <Ren.B...@bkfs.com> wrote:

Roger W. Suhr

unread,
Feb 26, 2015, 11:48:48 AM2/26/15
to
Hi,

The record length should be the length of the variable you retrived,

So for STEM X., you may do a "len = Length(x.{entry})". This would give you the length of that record.
Try it out. It's not the true record length (RDW length of 4 bytes is NOT included), but if you need that you just add 4 to length(x.{entry}).
Len = length(x.{entry}) + 4
Voila!

Have fun

Roger

Evans, James R. , RET-DAY

unread,
Feb 26, 2015, 11:53:44 AM2/26/15
to
Or perhaps you could use the IBM REXX Stream function package (free download, easy install). The package includes a CHARIN function which allows you to specify the number of characters to read from a dataset/stream. With this function package (which includes many handy I/O functions), EXECIO is a last resort.

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of Don Imbriale
Sent: Thursday, February 26, 2015 11:32 AM
To: TSO-...@VM.MARIST.EDU
Subject: Re: [TSO-REXX] EXECIO with VB datasets

Brenton, Ren

unread,
Feb 26, 2015, 12:16:18 PM2/26/15
to
Don, thank you. The solution was to simply ask length of the record, LENGTH(X.i), in the DO loop of my example. It returns the length of each record (without the 4 byte descriptor). Perfect. Once I get the number of bytes I need, I LEAVE the loop, and knowing the record count, I can then copy that number of records to my new dataset.

Thank you all for your suggestions.

Ren
Ext. 1448

Paul Gilmartin

unread,
Feb 26, 2015, 12:27:23 PM2/26/15
to
On 2015-02-26, at 10:15, Brenton, Ren wrote:

> Don, thank you. The solution was to simply ask length of the record, LENGTH(X.i), in the DO loop of my example. It returns the length of each record (without the 4 byte descriptor). Perfect. Once I get the number of bytes I need, I LEAVE the loop, and knowing the record count, I can then copy that number of records to my new dataset.
>
Perhaps simply by 'EXECIO' number 'DISKW ...'


On 2015-02-26, at 09:25, Lee, Bill wrote:

> What if you used RECFM=U? Would that work?
>
Works for z/OS 2.1 (and presumably higher). It may not be
the most direct solution to the original problem.

-- gil

richard rozentals

unread,
Feb 26, 2015, 1:09:09 PM2/26/15
to
Hi, In the past(over 20 years ago) I used SORT to extract the first 4 bytes. As per my memory it was in the Syncsort manual.
Richard Rozentals 

Roger W. Suhr

unread,
Feb 26, 2015, 1:17:29 PM2/26/15
to
Hi,

Like many higher level programming languages (COBOL, PL/1), REXX does not
give the programmer access to the RDW, but it sets the length of the record
retrieved as the variable length when using the (STEM x.) variant of EXECIO.
EXECIO is of course environment dependent, and I only know it's use in z/OS
(MVS); I'm not sure if it works in z/VM CMS the same way. This has been
working like this since the porting of REXX to MVS (from VM). I also don't
like to use STACK I/O, so I'm not sure how this would work if you'd use that
variant of the EXECIO command.

To write variable record datasets you need to allocate them as RECFM=VB,
LRECL={longest anticipated record length}, up to 32767 (minus 4 for the RDW;
that is the highest positive number fitting in 2 bytes x'7FFF'). (I believe
z/OS 2.1 and above allow you now the work with RECFM=VBS records, so the
record length can be larger. The only limit I know of at this point is; how
much virtual storage you have available in your TSO session (REGION). (I
haven't really tried that yet, so there may be some other hang ups.). When
you use the DISKW parameter and the STEM x. variant, EXECIO will use the
length of the current variable (e.g. x.{array entry number}, to set the RDW
correctly (It's essentially using the QSAM access method in z/OS). There is
no way for the programmer to "fiddle" with the RDW, and that is good!

Thank you

Roger


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of
Paul Gilmartin
Sent: Thursday, February 26, 2015 11:27 AM
To: TSO-...@VM.MARIST.EDU
Subject: Re: [TSO-REXX] EXECIO with VB datasets

Hobart Spitz

unread,
Feb 26, 2015, 2:20:29 PM2/26/15
to
With VB, the record lengths (as reported by REXX length() ) might not be
the max possible, as determined by the LRECL. So if you want to get the
actual LRECL, for example if you are (re)allocating a dataset, you can use
LISTDSI.
--
OREXXMan

Robert Zenuk

unread,
Feb 26, 2015, 6:24:12 PM2/26/15
to
I had missed the ability to work with VBS in REXX in z/OS 2.1. It works great!

/* rexx */
"EXECIO * DISKR SMF (STEM SMF. FINIS"
ERC = RC
say smf.0 'records'
do i=1 to smf.0
say left(smf.i,80)
end
exit ERC

This opens several opportunities...

Thanks!

Rob

Paul Gilmartin

unread,
Feb 26, 2015, 8:27:05 PM2/26/15
to
On 2015-02-26 16:23, Robert Zenuk wrote:
> I had missed the ability to work with VBS in REXX in z/OS 2.1. It works great!
>
What does it do with LRECL=X? I suppose it might be
limited only by available virtual storage.

Does it write and read equally well?

Mickey

unread,
Feb 27, 2015, 4:54:44 AM2/27/15
to
Oh, COBOL does, you just have to fool it. You create an 01 level in your FD
with an occurs 0 to 1 depending on squat, set squat to -1, and presto,
you're walking backward through the buffer, and both RDW and BDW are
available.

The sad part is, I am old enough to remember doing this :(

Mickey

-----Original Message-----
From: Roger W. Suhr

Steve Coalbran

unread,
Feb 27, 2015, 5:12:33 AM2/27/15
to
PL/1 too, I used to do it a lot!
Do they still use PL/1?! :-O
SÃ¥vida annat inte anges ovan: / Unless stated otherwise above:
IBM Svenska AB
Organisationsnummer: 556026-6883
Adress: 164 92 Stockholm

Robin Ryerse

unread,
Feb 27, 2015, 2:42:05 PM2/27/15
to
The interesting aspect of this thread is how REXX maintains the length of
each and every variable it sets.

Consider how you would handle the following task. A file of variable length
records is wasting file space because certain records contain extraneous,
trailing data of spaces. Your task is to repair the file by removing the
trailing spaces from each record where 'record type' has the value of "xx".
A programmer with good knowledge of system utilities would not use REXX to
accomplish this task


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of

Roger W. Suhr

unread,
Feb 27, 2015, 2:53:52 PM2/27/15
to
Hi,

Even that is easily accomplished in REXX by using the trim() function. With
that function you can remove tailing space from a variable. Another good
function is the substr() function which allows you to extract a substring
from a variable at the desired length.
What system utility would you suggest to use to accomplish this?

Roger

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of
Robin Ryerse
Sent: Friday, February 27, 2015 1:42 PM
To: TSO-...@VM.MARIST.EDU

Roger W. Suhr

unread,
Feb 27, 2015, 3:15:58 PM2/27/15
to
I just read up on it when z/OS 2.1 was first released (Migration Guide). I haven't tried myself, but it really looks like available virtual storage is the only limit. For me it's interesting, because for the first time ever, I can read SMF records with REXX and actually get the whole record, no matter how long it is. How to use that ability is something I still need to figure out. ;-)

Roger

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of Paul Gilmartin
Sent: Thursday, February 26, 2015 7:27 PM
To: TSO-...@VM.MARIST.EDU
Subject: Re: [TSO-REXX] EXECIO with VB datasets

Pedro Vera

unread,
Feb 27, 2015, 3:38:52 PM2/27/15
to
> easily accomplished in REXX by using the trim() function

Likely, you meant the STRIP() function.



Pedro Vera
DB2 Admin Tool
http://www-01.ibm.com/software/data/db2imstools/db2tools/db2admin/

Roger W. Suhr

unread,
Feb 27, 2015, 3:44:00 PM2/27/15
to
Oops, yeah STRIP() is better for REXX, sorry TRIM() is another language.

Roger

-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of
Pedro Vera
Sent: Friday, February 27, 2015 2:38 PM
To: TSO-...@VM.MARIST.EDU
Subject: Re: [TSO-REXX] EXECIO with VB datasets

Thomas Berg

unread,
Mar 9, 2015, 3:52:23 AM3/9/15
to
The greatest parts of REXX is those you use without even think about...



Best Regards,
Thomas Berg
___________________________________________________________________
Thomas Berg Specialist zOS/RQM/IT Delivery Swedbank AB (Publ)



> -----Original Message-----
> From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of Robin
> Ryerse
> Sent: Friday, February 27, 2015 8:42 PM
> To: TSO-...@VM.MARIST.EDU

Robin Ryerse

unread,
Mar 9, 2015, 7:46:19 PM3/9/15
to
Look at the specs closely. If this were your task as assigned by management,
they would not be concerned unless the file were quite large. Although REXX
would be efficient in identifying and repairing records, it would operate
poorly in handling the volume of records. SORT would be my utility of
choice.
0 new messages