On Wed, Sep 10, 2014 at 5:22 PM, Charles Mills <[email protected]> wrote: > I am responsible for an LE-enabled program that runs as a conventional STC > but uses various USS services and hence requires an OMVS segment. Currently, > if it does not have one, it fails with a U4093/90 (?) ABEND. I would like it > to be a little neater than that and put out a "No OMVS segment" message and > quit gracefully. > > Is there a function or MACRO that will tell me yea/nay on having an OMVS > segment? > > Thanks, > > Charles
I have never done this because we set up the RACF facility which automatically creates an OMVS segment if a RACF id which does not have one attempts to do any UNIX work. But I am fairly sure the magic word is "querydub". It is documented here: http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/BPXZB1C0/2.145 77 QUERY-DUB PIC X(8) VALUE IS "BPX1QDB'. 77 QD-RETVAL PIC S9(9) BINARY. 77 QD-RETRC PIC S9(9) BINARY. 77 QD-RETRSN PIC S9(9) BINARY. CALL QUERY-DUB USING QD-RETVAL QD-RETRC QD-RETRSN. IF QD-RETVAL IS EQUAL TO 4 THEN DISPLAY 'UNIX FACILITIES ARE NOT AVAILABLE TO THIS JOB DUE TO RACF REQUIREMENTS' UPON SYSOUT MOVE +20 TO RETURN-CODE STOP RUN END-IF I am fairly sure that something like the above will work for you. Oh, for some reason I think you are using COBOL. But the above manual has examples in HLASM too. C would be more difficult. You'd need to declare BPX1QDB as having OS linkage conventions. I don't recall off hand how to do a "fetch" and "dynamic call" in C. And I don't have any examples here at home. -- There is nothing more pleasant than traveling and meeting new people! Genghis Khan Maranatha! <>< John McKown ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
