C/C++ for MVS: Reading the master catalog

10 pts.
Tags:
C/C++
MVS
OS/390
z/OS
I'm trying to get the same output as "ls '*'" from z/OS FTPD. I think this can be done by reading the master catalog. Until now I found no way to open it from C. I found out that the master catalog path is in SYS1.NUCLEUS(SYSCATLG). It says: S6SYS1113CCATALOG.Z16S.MASTER So, my master catalog is CATALOG.Z16S.MASTER. I thought I could be able to open it with fopen, but it doesn't work. Am I missing something? Any help is appreciated. IBMUSER:/u/ibmuser: >uname -a OS/390 ADCD 16.00 03 9121

Answer Wiki

Thanks. We'll let you know when a new response is added.

You’re quite correct in saying that sys1.nucleus(syscatlg) points to the master catalog. However most sites only have system datasets in their master catalog. All other datasets are in a handful of user catalogs (which are also cataloged in the master catalog). Also remember that catalogs are used for traditional z/OS datasets, and not for UNIX Systems Services (USS) files.

I’m assuming that you want to list traditional z/OS datasets (otherwise, you could simply open and read the USS directory). This has always been a bit of a difficult problem to solve for z/OS programmers.

z/OS provides the macros LOCATE and CAMLST to create parameter lists and call the Catalog access services (documented in the DFSMSdfp Advanced Services manual). You could look at these macros and convert them to C/C++. However this will be quite difficult. Unfortunately, I can’t find any C/C++ runtime functions to do the same thing.

The other option is to look at some freeware sites to see if anyone else has done this. Go to this <a href=”http://www.longpelaexpertise.com.au/links”>link page</a>, and hop down to the Freeware & Downloads section for a good list.

Hope this helps.

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Meandyou
    Why not use normal MVS (z/OS) commands to access your catalog? Things like LISTCAT come to mind. Output to a dataset. Then use your program (written in C or whatever) to read the dataset.
    5,220 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following