I'd like to sum it up for those who don't know C on z/OS:

to read a member of a partioned data set, you have at least the following
possibilities:

a) specify the full name (DSN + member) in apostrophes on the fopen
function call

b) without apostrophs, then the TSO prefix or RACF id is added

c) DD:DDNAME + member name on fopen, DSNAME on DD statement

d) DD:DDNAME on fopen, DSNAME + membername on DD statement

maybe more, which I'm not aware of at the moment.

Furthermore, it's easy to read the directory of the PDS using normal
binary file I/O - this way you can read the member names and - for example -
fopen all the members in a PDS one by one - much the same way as
the ISPF library services do it.

Kind regards

Bernd




Am 15.09.2012 16:51, schrieb Bernd Oppolzer:
I normally don't use anything but dd:myfile
and do all the other thing at JCL level.

But there is one other thing which I find pretty nice:

it's also possible to fopen a file using

dd:myfile(member)

and have the ddname myfile assigned to a PDS library,
this way opening, say

userid.my.pds.library(member)

Of course this is pretty flexible, esspecially if you compute the
fopen filename string at runtime, for example

strcpy (filename, "dd:myfile(");
strcat (filename, membername);
strcat (filename, ")");

It is possible to specify all those dsname and membername parts
using lower chars; they are converted to upper chars by LE.

Kind regards

Bernd




Am 15.09.2012 15:31, schrieb Charles Mills:
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.)

Charles



----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to