I guess I AM losing my mind.
Looking more closely at my previous programs, I see one that definitely inserts
apostrophes around the passed filename before issuing fopen, and another that
does not ... but on reviewing the code it appears that although there is a
switch statement in the routine with a dsname: case, it never actually gets
called with a dataset name.
I guess fopen() always (assuming RACF? SAF?) behaves in the way that I thought
was an anomaly (as documented, in other words).
In any event quoting (apostropheing?) the dataset name should be harmless
(assuming one does not want a userid prepended).
I would still assert the documentation could be a heckuva lot clearer. At the
very least, Chapter 5 could have a line that said "and in many cases the
dataset name is first prefixed with a userid -- see Chapter 10."
If I had my druthers the C library would not be doing me this "favor" at all.
If I issue fopen("FOO.BAR", then try to open FOO.BAR, not some other file. They
could have simply given us an optional library function prepend_user that would
turn FOO.BAR into userid.FOO.BAR for those that wanted that function.
I know nothing is more pointless than "how I would re-design MVS" discussions
but you know what would have made this whole set of problems more intuitive? If
when they originally wrote OS they had followed what became the convention in
UNIX and DOS, where foo/bar is relative and /foo/bar is absolute. They could
universally (including DSN=) have made ".FOO.BAR" mean absolute FOO.BAR but
"FOO.BAR" mean userid.FOO.BAR.
Thanks all for your patience.
Charles
-----Original Message-----
From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf
Of Charles Mills
Sent: Saturday, September 15, 2012 6:31 AM
To: [email protected]
Subject: Re: C and LE -- when prepend userid on file names?
Well, that's certainly pretty clear and explicit. Thanks. But unless I am
losing my mind, that is not the behavior I am used to seeing.
It would also be nice if they put this all in one place. I have read Chapter 5,
"Opening Files," about ten times. That's where I would expect to find
information on, well, opening files -- not under "Performing OS I/O Operations."
I am going to play with this some more. As I say, I don't think my other
programs see this behavior. fopen("FOO.BAR", ... tries to open FOO.BAR, not
MYUSER.FOO.BAR. (Yes, we run RACF.)
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN