View previous topic :: View next topic
|
Author |
Message |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
dbzTHEdinosauer wrote: |
are pds directorys maintained in sorted order. don't think so.
as a result, the sorted or unsorted member names has no effect.
|
I do :-) |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
OK - after a hard day's graft in the sunshine...I hope that this covers what Dick was wanting me to cover...
Code: |
/*- Rexx -------------------------------------------------------------*
| |
*------------------------------------------------------------- Rexx -*/
trace '?i'
mystem.0 = 6
mystem.1 = 'one'
mystem.2 = 'two'
mystem.3 = 'three'
mystem.4 = 'four'
mystem.5 = 'five'
mystem.6 = 'six'
drop mystem.3
mystem.5 = '00'b
'ALLOC FI(FMTLST) DS(SOURCE.FMT) SHR REUSE'
'EXECIO 'mystem.0' DISKW FMTLST (STEM mystem. FINIS)'
'FREE DD(FMTLST)'
Exit |
And the output:
Code: |
one
two
MYSTEM.3
four
..
six |
Sorry about the .. but textpad would not allow me to cut text that contains a null value.
So, properly coded, stem.0 can be used to write non-existent - or previously dropped variables and variables with the 'null' value. If the manual says it cannot then the manual is WRONG. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
SIGH,
no, the manual says when you use the arbitrary number of lines format
DISKW *
the 0th variable has no effect.
the manual is correct,
dbz wrote but Nic refuses to read wrote: |
populate the first 3 stem variables (1,2, and 3)
drop stem.4 or populate stem.4 with "" (zero length value)
populate stem.0 with 0,1,2 or 4 >4 (does not matter)
DISKW * (stem. finis
it will output 3 records.
|
|
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Nic Clouston wrote: |
So, properly coded, stem.0 can be used to write non-existent - or previously dropped variables and variables with the 'null' value. If the manual says it cannot then the manual is WRONG. |
No, what the manual says is:
Quote: |
The 0th variable has no effect on controlling the number of lines written from variables. |
Thus, if your example were modified to:
Code: |
/*- Rexx -------------------------------------------------------------*
| |
*------------------------------------------------------------- Rexx -*/
trace '?i'
mystem.0 = 6
mystem.1 = 'one'
mystem.2 = 'two'
mystem.3 = 'three'
mystem.4 = 'four'
mystem.5 = 'five'
mystem.6 = 'six'
drop mystem.3
mystem.5 = '00'b
foo = 5
'ALLOC FI(FMTLST) DS(SOURCE.FMT) SHR REUSE'
'EXECIO 'foo' DISKW FMTLST (STEM mystem. FINIS)'
'FREE DD(FMTLST)'
Exit |
the EXECIO statement would only write five records, despite mystem.0 having the value 6. So Mr. Brenholz correctly states that
Quote: |
the value of the 0th variable has no effect when DISKW * format is used.
when the 0th variable is used as the LINES parm
DISKW stem.0
it is treated just like any other variable. |
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
The directory entries in a PDS are stored in the alphabetical order of member names. So if a new entry is to be created, all the entries coming after it need to be shifted to make room for it.
I stand corrected..
Bill,
your thinking was correct;
mine was not. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Akatsukami: What has 'foo' got to do with it? We are discussing stem.0 in the 'number of lines to write' position as opposed to using *. You could make foo = 6 and you will get the same result as stem.0 = 6. You could set stem.0 = 5 and you will get the same result as foo = 5.
Dick: are you thinking that I am referring to stem.0 within the brackets? Why should I? I am referring to the number of lines to write and that is the first parameter after EXECIO - as my code clearly shows - not the stem parameter within the brackets/parentheses.
As the manual says (paraphrased) if you give '*' then EXECIO will write until it reckons it has found a stop writing condition. If you give a specific number of lines to write from a stated stem then it will write that number of lines even if it has to write the default values e.g. MYSTEM.99
Now, if you are all believing that I am talking about stem.0 within the brackets then this entire debate is based on false premises and should be deleted. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
there is a lot of confusion/miswording around here ....
<stem>.0 has relevance ONLY for reading ( where it gets filled )
when writing
EXECIO *
EXECIO <somevar>
the fact that somevar is a stem element is completely irrelevant,
it is used as a simple/plain variable
it is nowhere implied that for a write the zeroth stem value will be used
cheers |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Exactly, Enrico. And I really think that Dick and I are talking 2 different things - me about the explicit use of stem.0 in the lines to write position and Dick about the implicit use in the data to be written portion of the command where it is ignored as Dick says and the manual says. But, until Dick comes back, we cannot be 100% certain. If this is the case then most of the posts can be deleted as being irrelevant and possibly misleading. The debate probably would not have started if I had written along the lines of "do not use '*' as the number of lines to write but the stem.0 in the 'lines to write' position of the command. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Nic wrote: |
The debate probably would not have started if I had written along the lines of "do not use '*' as the number of lines to write but the stem.0 in the 'lines to write' position of the command.
|
we would have had a different debate,
but a debate, nevertheless.
but the point is taken and accepted.
the script in question in this thread could have been written:
"EXECIO " k "...."
thus saving the time to load text.0 with the value of k
which at the time of ALLOC/EXECIO was accurate.
which would have included any zero length records,
and not have terminated the DISKW.
I was under the mis-understanding that Nic did not know
that stem.0 has no effect on a DISKW
unless stem.0 is the variable used as the LINES parm.
I also do not feel there is any necessity to delete any posts.
I am willing to have any errors of my posts stand as
a good example of
a bad example. |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
And I, who have 48 years' experience, but nonetheless have never used REXX or dealt with these issues, and therefore have essentially no idea what you guys are talking about, have thoroughly enjoyed the discussion.
Quite civil, but then again no one here but us mice. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
You should have heard the words going on in my head - and I suspect it was the same with Dick. But publicly blowing a fuse does not help. Of course it did not help that we were arguing about different things and therefore not arguing at all. We were arguing our own corners but in different rings! |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
this thread has attracted a lot of views
(a couple obviously attributable to Nic and me).
I wonder what is going around in the heads of those
who seeing a 4 page thread on creating pds from PS
and expect a novelette of '50 ways to leave your lover'. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
Excellent!
Actually, I am on an archaeological dig at the moment. Yesterday an elderly couple came to the side of the trench: She: what was you best find? He: Your wife! Me: No, that was my best loss! Laughs all round. (never married - yet) |
|
Back to top |
|
|
|