Page 1 of 1

Retrieving VSAM dataset name

PostPosted: Fri Jun 27, 2008 2:04 am
by cartman2112
I'm just getting back into Assembler coding after a long hiatus and have run into a problem that I cannot find an answer for. I would like to retrieve the dataset name for a VSAM file to place on a 'run time statistics report' that I will be producing in my program. I know how to retrieve the non-VSAM dataset names via RDJFCB but I cannot find an equivalent for VSAM. Any ideas or samples would be greatly appreciated!!

Thanks in advance!
Homer

Re: Retrieving VSAM dataset name

PostPosted: Sat Jun 28, 2008 8:40 am
by sbs1259
Hi,

Use dynamic information retrieval via SVC 99. See: http://publibz.boulder.ibm.com/epubs/pdf/iea2a870.pdf chapter 26 dynamic information retrieval text units. Even though this is the guide for authorized programs, authorization is not required for dynamic information retrieval. This will for for any dataset if you have the DDNAME.

Sam

Re: Retrieving VSAM dataset name

PostPosted: Sun Jun 29, 2008 10:23 am
by cartman2112
Thanks Sam!

Didn't even think about SVC 99! But I did come up with a down and dirty way to obtain this info. I coded a dummy DCB in my program. Moved the DDNAME from the ACB to the DCB and and issued an RDJFCB against the dummy DCB. Just make sure you don't try to open the DCB. It WILL blow all to hell with an S013 or an S240!! Thanks again!!

Homer

Re: Retrieving VSAM dataset name

PostPosted: Fri Nov 11, 2011 1:38 am
by BillW
VSAM macros have the ability to return the dsn of the file. Don't have a current vsam book in front of me (and if I had one, it would be 20+ years old by now), but I have done that before, a long time ago, in a different operating system (VM/CMS)