• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1528
  • Last Modified:

C/C++ for MVS: How do I read the master catalog?

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.

IBMUSER:/u/ibmuser: >uname -a
OS/390 ADCD 16.00 03 9121
0
cvaduva
Asked:
cvaduva
  • 5
  • 4
1 Solution
 
giltjrCommented:
Um, are you the (or one of the) system programmers?  If you are not, then I would strongly suggest you start talking to them.

I kind of suspect you are not a system programmers, as the system programmer would know what the master catalog name is without looking at syscatlg.  However you are running a AD/CD system, which are supposed to be "turnkey" system and system programmers are not (in theory) supposed to be needed.

I personally would have to do some research to figure this out, I am a system programmers but I deal with networking side of the house normally.
0
 
giltjrCommented:
Also, how are you planning to run this program?

Under CICS, TSO, straight batch, Unix System Services, or something else?
0
 
cvaduvaAuthor Commented:
I want to run it from USS
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
giltjrCommented:
Do you really want to read the master catalog, or do you want to be able to get a list of data sets based on a prefix?

From Unix System Services you should be able to call TSO services from C++ and use the LISTCAT LEVEL function.

If you get into Unix System Services from a command prompt you can do:

     tso "listcat level('sys1')"

to get an idea of what the output will be like.  I really don't think you want to be walking the master catalog itself.  I'm checking to see if there are any of the catalog routines that are directly callable from Unix System Services without using TSO and  LISTCAT.

0
 
cvaduvaAuthor Commented:
Yes, I know of tso listcat, but I need to do that from C to read the catalog structure and display it however I like.
I searched alot and I don't believe there's a function to do that.
I was thinking of assembly code - calling some SVC..
0
 
giltjrCommented:
O.K., I'm not a C++ programmer.  But you should be able to use IGGCSI00, which is a IBM supplied Catalog Search routine.

This is typically called from Assemble or REXX (there are samples in SYS1.SAMPLIB with member names IGGCSIxx).  However according to the manual you can call IGGCSI00 from a higher level language as long as the higher level language invokes IGGCSI00 using an assember language CALL with V-type address, LINK, or LOAD and CALL.

I would assume that C++ allows you to invoke/call/link other routines using these.

You can call TSO subroutines from C++ and just parse the output of the LISTCAT command.  Execpt for VSAM files there is not a whole lot of information in a catalog entry, bascially the file name, sms class names, and volume names.

Although EE is great, there are not a whole lot of z/OS (or other IBM "z" operating systems) experts here.  You may want to join the list server group IBM-Main (http://alabamamaps.ua.edu/archives/ibm-main.html) and post the question there.  There are plenty of people there that would know if this could be done and how to do it.
0
 
cvaduvaAuthor Commented:
I posted the question on http://alabamamaps.ua.edu/archives/ibm-main.html and there were many answers.
Thanks so much :)
0
 
cvaduvaAuthor Commented:
The solution would be to use the free catsearch tool ( http://dovetail.com/docs/coz/dsp-ref_catsearch.html ) or implement something similar.

Thanks for the help.
Best regards
0
 
giltjrCommented:
Since the ls command does not show the DCB information, you might want to look at the source code and figure out how to call IGGCSI00 your self.  That way you don't waste the time/cpu cycles going out to read the VTOC for every file you want to list.

Glad to have been some help.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 5
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now