Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Example of an exit routine

&pagelevel(3)&pagelevel

The example below illustrates how an exit routine and fulfilling the following three particular requirements can be implemented:

  1. Under the ID USERID01 no free tapes are to be newly reserved; any request to this effect is to be rejected.

  2. The user ID USERID02 should only be assigned those free tapes whose archive number begin with the number ’3’. For these archive entries, the user field should be predefined with the string ’** EXIT-TEST **’. Since the range of numbers cannot be changed for any new reservations via the MAREN-ARCHIVE link (LAFUNKNM=MARENFA2), reservation must be aborted for an archive number which does not begin with the number ’3’.

  3. For all new reservations, the administration field should be predefined with the ’MAREN’ string.

MARENEX1 CSECT
         STM   14,12,12(13)
         USING MARENEX1,15
         L     7,0(,1)                          GET @(ARCHREC)
         USING MARENA,7
         CLC   OWNERID,CANUID
         BE    CANCEL
         CLC   OWNERID,=CL8'USERID02'
         BNE   RETURN
         CLC   LAFUNKNM,=CL8'MARENFA2'          CALLER=ARCHIVE EXIT?
         BNE   CONTINUE                         IF NOT ->
         CLI   NUMMANFV,C'3'                    VSN O.K.?
         BNE   CANCEL                           IF NOT - REJECT
         B     UPDATE
CONTINUE MVC   NUMMANFV,=CL6'3'                 SET FROM-OPERAND
         MVC   NUMMEND,=CL6'399999'             SET TO-OPERAND
UPDATE   MVC   USERFELD,=CL54'** EXIT-TEST **'
RETURN   MVC   RZFELD,RZTEXT
         LM    14,12,12(13)
         XR    15,15
         BR    14                               NORMAL-RETURN
CANCEL   LM    14,12,12(13)
         LA    15,4                             INDICATE ERROR
         BR    14                               
REQUEST  CANCEL
CANUID   DC    CL8'USERID01'
RZTEXT   DC    CL8'MAREN'
         LTORG
         MARENA LAYOUT=V8
         END