Re: Rexx and member statistics question

2016-03-19 Thread Paul Gilmartin
On Sat, 19 Mar 2016 15:12:36 -0400, Pinnacle wrote:

>On 3/19/2016 11:05 AM, Frank Clarke wrote:
>> On 30 Dec 2015 14:26:08 -0800, (Ze'ev Atlas) wrote:
>>
>>> Originally, I had "EXECIO * DISKW XXOUT (STEM INPUT."
>>> but that would work only for members that had statistics (i.e. have been 
>>> updated).  When I changed the '*' to input.0 it works fine.  Is that a 
>>> normal behavior?  (I ran on z/OS 2.2! Ze'ev Atlas
>> 
Is that because all the members with statistics had been Edited and ISPF Edit
always pads empty lines?  What happens if:

o You have a member without statistics but containing only nonempty lines?

o You create statistics for a member containing empty lines?
  - Does it fail likewise despite having statistics?  Or
  - Does merely adding statistics scan the member and pad empty lines?

>> Never ever ever never never "EXECIO * DISKW"
>
>Good advice from Mr. Clarke.  EXECIO * DISKW will stop the output if it
>encounters a blank line.  Keep a counter of what you want to write and
>always use an explicit number of records for DISKW.
> 
My experience is that nonempty blank lines cause no problems; empty
lines are the culprit.  Have you evidence to the contrary?

CMS files are not allowed to contain empty lines, therefore an empty line
was reasonably, almost necessarily, a terminator for EXECIO * DISKW in
CMS.  I fear this CMS foolishness infected the design of MVS EXECIO.

-- gil

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


Re: Rexx and member statistics question

2016-03-19 Thread Pinnacle

On 3/19/2016 11:05 AM, Frank Clarke wrote:

On 30 Dec 2015 14:26:08 -0800,
004b34e7c98a-dmarc-requ...@listserv.ua.edu (Ze'ev Atlas) wrote:


Hi AllI have a Rexx program and here is the relevant snippet:
THEMEMBER = THEPDS || "(" || MEMBER || ")"   /*say themember */   "alloc shr 
file(input) dataset(" THEMEMBER ")"   "execio * diskr input (stem input. finis)"   IF RC \= 0 THEN 
call DIE 'READ MEMBER failed' RC  say member input.0 "LINES READ"

"free file(input)"   "EXECIO" input.0 "DISKW 
XXOUT (STEM INPUT."  IF RC \= 0 THEN call DIE 'WRITE MEMBER 
failed' RC

Originally, I had "EXECIO * DISKW XXOUT (STEM INPUT."
but that would work only for members that had statistics (i.e. have been 
updated).  When I changed the '*' to input.0 it works fine.  Is that a normal 
behavior?  (I ran on z/OS 2.2! Ze'ev Atlas



Late to the party... sorry.

Never ever ever never never "EXECIO * DISKW"

There is ALWAYS information adequate to allow you to say the exact
nuber of records you want written.  Always.   Whether it's "queued()"
or "stem.0" or "42", you already have enough information to make the
DISKW happen the way you want it to happen.   Never rely on "*".

Never.



Good advice from Mr. Clarke.  EXECIO * DISKW will stop the output if it 
encounters a blank line.  Keep a counter of what you want to write and 
always use an explicit number of records for DISKW.


Regards,
Tom Conley

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


Re: Rexx and member statistics question

2016-01-01 Thread Shmuel Metz (Seymour J.)
In <613235584.5279438.1451514349980.javamail.ya...@mail.yahoo.com>, on
12/30/2015
   at 10:25 PM, "Ze'ev Atlas"
<004b34e7c98a-dmarc-requ...@listserv.ua.edu> said:

>Hi AllI have a Rexx program and here is the relevant snippet:
>THEMEMBER = THEPDS || "(" || MEMBER || ")"       /*say themember */  
>                            "alloc shr file(input) dataset("
>THEMEMBER ")"   "execio * diskr input (stem input. finis)" 

I assume that this is not what you actually ran, but that there was a
new line or semicolon separating the statements.

>Originally, I had "EXECIO * DISKW XXOUT (STEM INPUT."  

That doesn't do what you think it does; it will stop on a null line.

>but that would work only for members that had statistics

It should work for any member with sequence numbers.

>When I changed the '*' to input.0 it works fine.  Is that a normal
>behavior?

It is if the member is unnumbered.

-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 ISO position; see  
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

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


Re: Rexx and member statistics question

2016-01-01 Thread Shmuel Metz (Seymour J.)
In
<8615408156966260.wa.elardus.engelbrechtsita.co...@listserv.ua.edu>,
on 12/31/2015
   at 03:20 AM, Elardus Engelbrecht 
said:

>Anyways, I don't believe member stats have any influence in 
>reading and writing of members in PDS.

ISPF keeps the change level of lines in the sequence field.
 
-- 
 Shmuel (Seymour J.) Metz, SysProg and JOAT
 ISO position; see  
We don't care. We don't have to care, we're Congress.
(S877: The Shut up and Eat Your spam act of 2003)

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


Re: Rexx and member statistics question

2015-12-31 Thread Elardus Engelbrecht
Ze'ev Atlas wrote:

>I have to take it back
>In one of the libraries, I consistently have an empty line as the first line 
>and I did do some of my tests on that library.

This is WAD. You read something empty, then REXX processes stops.

>Mystery resolved!

Good! One riddle solved in 2015! ;-)

Anyways, I don't believe member stats have any influence in reading and writing 
of members in PDS. In fact, I have several REXX programs in Batch Jobs 
reading/writing members as generated by IEBGENER for example (which caused no 
member stats to be written at all, since AFAIK, IEBGENER does not update member 
stats)

AFAIK, Member stats are ONLY used by ISPF and other products (if they are 
designed to do that stats).

PS: I don't have any access to my z/OS toy for now... so above is based on my 
faulty decaying memory... 

Groete / Greetings
Elardus Engelbrecht

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


Re: Rexx and member statistics question

2015-12-31 Thread Paul Gilmartin
On Thu, 31 Dec 2015 09:05:20 +0200, Itschak Mugzach wrote:

>You might have blanks lines in input. Stem . It stops the writing of the stem 
>to dataset. Try changing null lines to blanks.
> 
No!  If the programmer's intent is to copy a file unchanged, the
programmer shouldn't change the content of any line.


On Thu, 31 Dec 2015 03:20:32 -0600, Elardus Engelbrecht wrote:
>
>This is WAD. You read something empty, then REXX processes stops.
> 
It does not; it faithfully creates a corresponding empty item in the input STEM.

>Anyways, I don't believe member stats have any influence in reading and 
>writing of members in PDS. In fact, I have several REXX programs in Batch Jobs 
>reading/writing members as generated by IEBGENER for example (which caused no 
>member stats to be written at all, since AFAIK, IEBGENER does not update 
>member stats)
>
For example, NFS, and perhaps FTP, update member stats.

Why do people have such cognitive dissonance with the concept of empty records?
Ever since the advent of Arabic numerals, zero has been recognized as a valid
number.  Or should be.

-- gil

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


Re: Rexx and member statistics question

2015-12-30 Thread Paul Gilmartin
On Wed, 30 Dec 2015 22:12:37 -0600, Dale R. Smith wrote:
>
>According to the TSO REXX Reference, if "*" is used with DISKW and a STEM, 
>then stem.0 is ignored and it writes stem. records until it finds either a 
>null record or an uninitialized stem value.  For example, it you read a member 
>of a PDS into STEM mem. and the member contained 100 records, (mem.0 = 100), 
>then you wrote the stem to another member or file with EXECIO * DISKW and 
>(STEM MEM., it would write 100 records to the file, (mem.101 is not set).  If 
>you now read a PDS member with 90 records into the same stem name, (mem.0 = 
>90), and you wrote it out with EXECIO * DISKW and (STEM MEM., then it would 
>write the 90 records from the current member and the last 10 records from the 
>previous member!  Not good!
> 
All this provided that the input file contains no null record in which case it
would stop even sooner, at that null record.  Such a null record is what
caused the OP's problem.

>It would be best to use "EXECIO" mem.0 "DISKW" instead of "*" or to "Drop 
>mem." after the write and before the next read.  If the REXX program is 
>processing a lot of members, it may be a good idea to do both, because 
>dropping the stem will free up storage.
>
Dropping does not eliminate the hazard of the null record.  Do both.

-- gil

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


Re: Rexx and member statistics question

2015-12-30 Thread Itschak Mugzach
You might have blanks lines in input. Stem . It stops the writing of the stem 
to dataset. Try changing null lines to blanks.

ITschak

נשלח מה-iPad שלי

‫ב-31 בדצמ׳ 2015, בשעה 00:25, ‏‏Ze'ev Atlas 
‏<004b34e7c98a-dmarc-requ...@listserv.ua.edu> כתב/ה:‬

> Hi AllI have a Rexx program and here is the relevant snippet:
> THEMEMBER = THEPDS || "(" || MEMBER || ")"   /*say themember */   
> "alloc shr file(input) dataset(" THEMEMBER ")"   "execio 
> * diskr input (stem input. finis)"   IF RC \= 0 THEN  
>call DIE 'READ MEMBER failed' RC  say member 
> input.0 "LINES READ"  "free file(input)"  
>  "EXECIO" input.0 "DISKW XXOUT (STEM INPUT."  IF RC \= 0 THEN 
> call DIE 'WRITE MEMBER failed' RC 
> Originally, I had "EXECIO * DISKW XXOUT (STEM INPUT."  
> but that would work only for members that had statistics (i.e. have been 
> updated).  When I changed the '*' to input.0 it works fine.  Is that a normal 
> behavior?  (I ran on z/OS 2.2! Ze'ev Atlas
> 
> 
> --
> For IBM-MAIN subscribe / signoff / archive access instructions,
> send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

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


Re: Rexx and member statistics question

2015-12-30 Thread Dale R. Smith
On Wed, 30 Dec 2015 22:25:49 +, Ze'ev Atlas  wrote:

>Hi AllI have a Rexx program and here is the relevant snippet:
>THEMEMBER = THEPDS || "(" || MEMBER || ")"       /*say themember */            
>                   "alloc shr file(input) dataset(" THEMEMBER ")"   "execio * 
>diskr input (stem input. finis)"       IF RC \= 0 THEN                         
>            call DIE 'READ MEMBER failed' RC              say member input.0 
>"LINES READ"                  "free file(input)"                               
>"EXECIO" input.0 "DISKW XXOUT (STEM INPUT."      IF RC \= 0 THEN               
>                      call DIE 'WRITE MEMBER failed' RC             
>Originally, I had "EXECIO * DISKW XXOUT (STEM INPUT."  
>but that would work only for members that had statistics (i.e. have been 
>updated).  When I changed the '*' to input.0 it works fine.  Is that a normal 
>behavior?  (I ran on z/OS 2.2! Ze'ev Atlas

According to the TSO REXX Reference, if "*" is used with DISKW and a STEM, then 
stem.0 is ignored and it writes stem. records until it finds either a null 
record or an uninitialized stem value.  For example, it you read a member of a 
PDS into STEM mem. and the member contained 100 records, (mem.0 = 100), then 
you wrote the stem to another member or file with EXECIO * DISKW and (STEM 
MEM., it would write 100 records to the file, (mem.101 is not set).  If you now 
read a PDS member with 90 records into the same stem name, (mem.0 = 90), and 
you wrote it out with EXECIO * DISKW and (STEM MEM., then it would write the 90 
records from the current member and the last 10 records from the previous 
member!  Not good!

It would be best to use "EXECIO" mem.0 "DISKW" instead of "*" or to "Drop mem." 
after the write and before the next read.  If the REXX program is processing a 
lot of members, it may be a good idea to do both, because dropping the stem 
will free up storage.

-- 
Dale R. Smith

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


Re: Rexx and member statistics question

2015-12-30 Thread Charles Mills
Let's see if I have this right.

You EXECIO DISKR a PDS member into stem INPUT.

You then attempt to write it out using EXECIO DISKW * from stem INPUT. The 
write fails unless the member has ISPF statistics.

However, EXECIO DISKW INPUT.0 succeeds.

Do I have that right? If so, no, that sounds wrong to me.

What is the exact error? Any messages in the message log?

Have you checked
- did the read really work? Do the member's records appear to be in INPUT.1, 
INPUT.2, etc.?
- what is in INPUT.0? Is it the correct line count?

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Ze'ev Atlas
Sent: Wednesday, December 30, 2015 2:26 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Rexx and member statistics question

Hi AllI have a Rexx program and here is the relevant snippet:
THEMEMBER = THEPDS || "(" || MEMBER || ")"   /*say themember */ 
  "alloc shr file(input) dataset(" THEMEMBER ")"   "execio * 
diskr input (stem input. finis)"   IF RC \= 0 THEN  
   call DIE 'READ MEMBER failed' RC  say member input.0 
"LINES READ"  "free file(input)"   
"EXECIO" input.0 "DISKW XXOUT (STEM INPUT."  IF RC \= 0 THEN
 call DIE 'WRITE MEMBER failed' RC 
Originally, I had "EXECIO * DISKW XXOUT (STEM INPUT."  
but that would work only for members that had statistics (i.e. have been 
updated).  When I changed the '*' to input.0 it works fine.  Is that a normal 
behavior?  (I ran on z/OS 2.2! Ze'ev Atlas

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


Re: Rexx and member statistics question

2015-12-30 Thread Paul Gilmartin
On Wed, 30 Dec 2015 14:49:04 -0800, Charles Mills wrote:

>Let's see if I have this right.
>
>You EXECIO DISKR a PDS member into stem INPUT.
>
>You then attempt to write it out using EXECIO DISKW * from stem INPUT. The 
>write fails unless the member has ISPF statistics.
>
>However, EXECIO DISKW INPUT.0 succeeds.
>
>Do I have that right? If so, no, that sounds wrong to me.
>
It's documented that if a count is specified, that number of lines is written
from STEM.

If count is given as "*", writing terminates at the first null member of STEM.

Now, I'll conjecture:

If the member has ISPF statistics, it was probably created by ISPF EDIT, and
ISPF will never write an empty record.

If the member lacks ISPF statistics, it was probably created other than by
ISPF EDIT and may contain empty members.  The write will terminate at
the first empty line.

Bad design.  It would be better, when count is "*" to write until a DROPped
line of STEM. is encountered.

What happens if STEM.0 exceeds the number of defined lines of the compound?

What happens if count is "*", but a DROPed line is encountered before
an empty line?

All in all, a bad hangover from CMS which does not support empty records in
MDFS or SFS.

-- gil

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


Re: Rexx and member statistics question

2015-12-30 Thread Charles Mills
> to write until a DROPped line of STEM. is encountered.

My Rexx reference says "When EXECIO writes an arbitrary number of lines from a 
list of compound
variables, it stops when it reaches a null value or an uninitialized variable 
(one
that displays its own name)."

> What happens if STEM.0 exceeds the number of defined lines of the compound?

My Rexx reference says "The 0th variable has no effect on controlling the 
number of lines written from
variables."

But a good conjecture (that or something similar) on the OP's problem.

Charles

-Original Message-
From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf 
Of Paul Gilmartin
Sent: Wednesday, December 30, 2015 3:19 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Rexx and member statistics question

On Wed, 30 Dec 2015 14:49:04 -0800, Charles Mills wrote:

>Let's see if I have this right.
>
>You EXECIO DISKR a PDS member into stem INPUT.
>
>You then attempt to write it out using EXECIO DISKW * from stem INPUT. The 
>write fails unless the member has ISPF statistics.
>
>However, EXECIO DISKW INPUT.0 succeeds.
>
>Do I have that right? If so, no, that sounds wrong to me.
>
It's documented that if a count is specified, that number of lines is written 
from STEM.

If count is given as "*", writing terminates at the first null member of STEM.

Now, I'll conjecture:

If the member has ISPF statistics, it was probably created by ISPF EDIT, and 
ISPF will never write an empty record.

If the member lacks ISPF statistics, it was probably created other than by ISPF 
EDIT and may contain empty members.  The write will terminate at the first 
empty line.

Bad design.  It would be better, when count is "*" to write until a DROPped 
line of STEM. is encountered.

What happens if STEM.0 exceeds the number of defined lines of the compound?

What happens if count is "*", but a DROPed line is encountered before an empty 
line?

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


Rexx and member statistics question

2015-12-30 Thread Ze'ev Atlas
Hi AllI have a Rexx program and here is the relevant snippet:
THEMEMBER = THEPDS || "(" || MEMBER || ")"       /*say themember */             
                  "alloc shr file(input) dataset(" THEMEMBER ")"   "execio * 
diskr input (stem input. finis)"       IF RC \= 0 THEN                          
           call DIE 'READ MEMBER failed' RC              say member input.0 
"LINES READ"                  "free file(input)"                               
"EXECIO" input.0 "DISKW XXOUT (STEM INPUT."      IF RC \= 0 THEN                
                     call DIE 'WRITE MEMBER failed' RC             
Originally, I had "EXECIO * DISKW XXOUT (STEM INPUT."  
but that would work only for members that had statistics (i.e. have been 
updated).  When I changed the '*' to input.0 it works fine.  Is that a normal 
behavior?  (I ran on z/OS 2.2! Ze'ev Atlas


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


Re: Rexx and member statistics question

2015-12-30 Thread Ze'ev Atlas
You have it right
There is no error message, the lines are just not written!
ZA

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


Re: Rexx and member statistics question

2015-12-30 Thread Walt Farrell
On Wed, 30 Dec 2015 19:03:22 -0600, Ze'ev Atlas  wrote:

>You have it right
>There is no error message, the lines are just not written!

Perhaps you should display the contents of the input. stem variable before the 
EXECIO WRITE statement. That may give you (or us) a clue to what's happening.

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


Re: Rexx and member statistics question

2015-12-30 Thread Paul Gilmartin
On Wed, 30 Dec 2015 19:03:22 -0600, Ze'ev Atlas wrote:

>You have it right
>There is no error message, the lines are just not written!
>ZA
>
WAD.  Did your input contain empty records?

HEX on in ISPF BROWSE (*not* VIEW; *not* EDIT) will manifest empty records.
A dismaying example:

RC = BPXWDYN( 'alloc dsn('userid()'.TEMP.NULLS) shr rtddn(DD) msg(WTP)' )
line.1 = 'First '
line.2 = ''
drop line.3  /* WTF!?  */
line.4 = 'Fourth.'
address 'MVS' 'EXECIO 4 DISKW' DD '(finis stem LINE.'

creates (note line 3!):

 Top of Data ***

.

.
 ---
First   
.
C89AA4  
.
699230  
.
 -

.

.

.
 -
LINE.3  
.
DCDC4F  
.
3955B3  
.
 -
Fourth. 
.
C9A9A84 
.
664938B 
.
 -
*** Bottom of Data ***

IIRC:
o CMS filesystems do not support empty records (possibly excepting
  the new-fangled BFS.)
o CMS EXEC2 does not distingushed uninitialized variables from
  variables set to null string.

It appears that EXECIO on z/OS attempts to emulate the worst design features
of EXEC2 on CMS.

Rexx on CMS lately supports Rexx standard I/O.  Rexx on z/OS is hardly there 
yet:
o I believe compiled Rexx supports Rexx standard I/O. but only for legacy data 
sets.
o Rexx under OMVS has a function package for much of Rexx standard I/O,
  but only for UNIX files, and it does not provide SIGNAL ON NOTREADY.

Sigh,
gil

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


Re: Rexx and member statistics question

2015-12-30 Thread Ze'ev Atlas
I have to take it back
In one of the libraries, I consistently have an empty line as the first line 
and I did do some of my tests on that library.
Mystery resolved!

Thank you all

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