To add some suggestions to Paul's answers:
first, I don't think that there is a difference between PDSs and PDSEs
from the
programmer's point of view. The directory entry is variable length and
has much
information besides the member name added to it (possibly), but that
doesn't matter
to you - as I understand it, you are only interested in the member name,
so you can omit
the rest. The more interesting problem is: there are many directory
entries in one
record, and length fields etc., and the unpacking is a little bit
tricky. But I hope the
documentation provided by David will help you.
Then, for the file names:
it is, of course, possible to send the file names including the HLQs,
through the
JCL parm. I dont know at the moment, how to do it, but of course others
will
show you. The JCL parm has possibly LE run time parms before the slash,
and the argc/argv string, that is passed to the C main, after the slash.
Another method would be: pass the file name (with HLQ) without the
apostrophs
and add the apostrophs later in the program. Or, still simpler, use a
file name
like dd:ddname - and then add a DD statement for that ddname - that's what
I normally do.
Remember, you can fopen a file in C using the following file name variants
on "classical" z/OS:
fopen ("file.dsn", "r") - HLQ is added, much like in TSO
fopen ("\'myhlq.file.dsn\'", "r") - HLQ is present in the filename
fopen ("dd:ddname", "r") - needs a valid DD allocation
for PDSs and PDSEs you can optionally add membernames in parantheses
to all of those file name variants, even dd:ddname(member); then you can
allocate the PDS using ddname, but you specify the membername (= member)
on the fopen.
Kind regards
Bernd
Am 07.07.2013 16:46, schrieb Paul Gilmartin:
On Sun, 7 Jul 2013 09:24:27 -0500, Ze'ev Atlas wrote:
1. Is PDSE the same (I mean same structure of directory and directory entry) in
that regard?
No, but they fake it, so it doesn't matter.
2. Otherwise, where can I find documentation about PDSE in the sam econtext?
Secret. Perhaps available for a price and under NDA.
3. (Also otherwise) How would I distinguish between the two, either before or
during opening the directory short of manually checking and communicating the
fact to the C program?
As above, there's no need.
4. if I do PARM='/-PDS pAtTeRn MLQ.LLQ' that would work fine (it works fine now
for flat files), but how could I add the HLQ, because this requires enclosing
the file name in quotes and remember, this is in C context?
In other contexts (JCL?), the form is something like:
'//''HLQ.MLQ.LLQ'''
(View with monospaced font.) (Untested.)
-- gil
----------------------------------------------------------------------
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