I no longer have access to a mainframe to test my code, but something like this should work:
data _null_;
/* Assign a fileref to the PDS */
_rc=filename("myPDS","mydata.my.pdsfile");
_did=dopen("myPDS");
if _did ne 0 then do;
putlog "ERROR: Unable to open PDS to look at members";
_rc=filename("myPDS");
stop;
end;
do _i=1 to dnum(did); /* Get info for each PDS member */
MemberName=dread(did,i);
_rc=filename("thisMem",cats("myPDS(",MemberName,")","S");
_fid=fopen("thisMem");
do _j=1 to foptnum(_fid);
infoname=foptname(_fid,_j);
infovalue=finfo(_fid,infoname);
output;
end;
_rc=fclose(_fid);
_rc=filename("thisMem");
end;
_rc=dclose(_did);
_rc=filename("myPDS");
run;
Hope this at least gets you started 🙂
... View more