search cancel

SVC calls from ADS user BIFs running with zIIP

book

Article ID: 253626

calendar_today

Updated On:

Products

IDMS IDMS - ADS IDMS - Database

Issue/Introduction

An ADS user written built-in function (BIF) does an SVC Call to do a write to SMF.

Can we do SVC calls from User BIFs when running with zIIP?

 

Environment

Release : 19.0

Resolution

In general we do not support the issuing of SVC calls from user written programs as this can cause the CV to hang or abend.

There is an additional problem when running with ZIIP=Y because the ADS runtime code, including user BIFs, will execute on zIIP processors under an SRB rather than on a TCB.
In z/OS it is illegal to issue an SVC in SRB mode, you have to be in TCB mode. Issuing an SVC from an SRB will cause the IDMS CV to abort with an S0F8-4 abend code.

This means that if running with zIIP you cannot issue SVC calls from ADS User BIFs. 

To get around the problem you will have to do one of the following:

  1. Write a user invoked exit which runs in user mode to issue the SVC call

    User invoked exits are numbered 256 and above.
    You need to code a #DEFXIT entry in RHDCUXIT for the user exit, ensure it is defined as MODE=USER. 
    For example if you code a user exit 258, replace the entry in RHDCUXIT for that exit with:
             #DEFXIT MODE=USER,CALL=IBM,NAME=UX258,AMODE=ANY          EXIT 258 

    Specifying the exit with NAME= means the program has to be defined in the SYSGEN and can be defined with an initial storage area (ISA) which will be allocated and passed to the exit passed in register 11.
    In the user BIF replace the SVC call with a #XIT macro to call the exit. To pass parameters to the exit code:
    LA   R1,parms 
    #XIT 256,PARM=(R1).

    In the exit the passed parameters will be in the second word pointed to by register 1, to get the parameters code:
    L  R1,4(R1)

    Note the considerations for user mode exits in section Installing Numbered Exits in the System:

    The routine can access only the storage pages associated with it unless storage protection has been disabled at the system or the program level. 
    The exit routine:
    Runs as a program under the DC/UCF nucleus.
    Uses standard IBM calling conventions (except that no save area is passed in register 13). The exit is called by a #LINK statement.
    Cannot process register 15 Return codes.

    Here is a sample exit:

    UX258    TITLE 'UX258 -- ISSUE SVC'           
             #MOPT CSECT=UX258,ENV=USER           
             #ENTRY UX258EP1                      
             USING UX2568P1,R12                   
             USING WORK,R11                       
             LR  R12,R15                          
           L   R1,4(R1)          << R1 point to passed parameters     
           ...                   << additional code
             SVC nnn                              
             #RETURN                              
             #BALI                                
    WORK     DSECT      << passed ISA                 
    WORK_1   DS     18F                             
             END   
  2. Write a user program which runs in user mode to issue the SVC call

    In the user BIF replace the SVC call with a #LINK macro. To pass parameters to the program code:
    LA   R1,parms
    #LINK PGM='pgm_name',PARMS=(R1)

Additional Information

See the IDMS documentation sections User-invoked Numbered Exits, Installing Numbered Exits in the System and #LINK