Revised my earlier example; see embeded below

On 9/10/2014 7:35 PM, John McKown wrote:
On Wed, Sep 10, 2014 at 5:22 PM, Charles Mills <charl...@mcn.org> 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.

Maybe ...

#pragma linkage(BPX1QDB,OS);


int ret_val = 0;
int ret_code = 0;
int ret_reason = 0;

...


void BPX1QDB(int *, int *, int *);

...

   BPX1QDB(ret_val, ret_code, ret_reason);


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.




typedef void (*mydnamcl) (int *, int *, int *);

   mydnamcl callptr;

   ...

 callptr = (mydnamcl) fetch("BPX1DQB");

 (callptr) (&ret_val, &ret_code, &ret_reason);



Worth a shot.

-Steve Comstock

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to