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 3: Deleting an access condition

The TEST-GUA guard created in example 1 and changed in example 2 needs to be changed again:

  • JOHN is leaving the company. His access conditions therefore have to be deleted.

Solution

 *        **************************************************************
 *        * ---------------------------------------------------------- *
 *        *                                                            *
 *        * REMSAC macro: Delete access conditions                     *
 *        * ===========================================                *
 *        *                                                            *
 *        * ---------------------------------------------------------- *
 *        **************************************************************
 *
 GUA3     CSECT
 *
 *        **************************************************************
 *        * ---------------------------------------------------------- *
 *        * MOVE macro                                                 *
 *        * ==========                                                 *
 *        * Task:    Move PARMACL parameter area to PARMACC.           *
 *        * Purpose: This macro initializes the PARMACC parameter area *
 *        *          to be passed in register 1 before each call of    *
 *        *          the MODSAC macro.                                 *
 *        * ---------------------------------------------------------- *
 *        **************************************************************
 *
          MACRO
         MOVE
          LA    R@TO,PARRACC
          LA    R@TOL,PROX#
          LA    R@FR,PARRACL
          LA    R@FRL,PROX#
         ICM   R@FRL,8,=C' '
          MVCL  R@TO,R@FR
         MEND
 *
 *        **************************************************************
 *
 R@TO     EQU   6               Destination address
 R@TOL    EQU   7               Destination field length
 R@FR     EQU   8               Source address
 R@FRL    EQU   9               Source field length/fillers
 R@BASE   EQU   10              Base register
          BALR  R@BASE,0
          USING *,R@BASE
 *
 *        **************************************************************
 *        * 1. JOHN is leaving the company. His access conditions      *
 *        *    are removed from the guard.                             *
 *        **************************************************************
 *
          MOVE                                  Parameter initialization
          REMSAC MF=M,                                                  -
                GUARD='TEST-GUA',                                       -
                SUBTYPE=*USER,                                          -
                SUBIDS=('JOHN    ')
          REMSAC MF=E,PARAM=PARRACC
          CLC   PROXMRET,=Y(PROPSUCC)
          BNE   RCNOTOK
 *
         BE    ENDE
 *
 *        **************************************************************
 *        * Error recovery
 *        **************************************************************
 *
 RCNOTOK  EQU   *
 *        The possible return code values are listed in the MSGGUAD
 *        macro
         B     ENDE
 *
 ENDE     EQU   *
         TERM
 *
 *
 *        **************************************************************
 *        *------------------------------------------------------------*
 *        * Parameter declarations                                     *
 *        *------------------------------------------------------------*
 *        **************************************************************
 *
 *        This parameter area is passed in register 1 when the REMSAC
 *        macro is called.
 *
 PARRACC  DS    0F
          REMSAC MF=C
 *
 *        This parameter area is called in order to initialize the 
 *        PARRACC parameter area before the REMSAC macro is called.
 *
 PARRACL  DS    0F
          REMSAC MF=L,                                                  -
                SUBTYPE=*USER,                                          -
                GUARD='                                        '
 *
 *        **************************************************************
 *        *------------------------------------------------------------*
 *        * Declarations of the return codes                           *
 *        *------------------------------------------------------------*
 *        **************************************************************
 *
         MSGGUAD MF=D
 *
 *        **************************************************************
 *        *------------------------------------------------------------*
 *        * Declarations of global variables                           *
 *        *------------------------------------------------------------*
 *        **************************************************************
 *
         SACMGMT MF=D,XPAND=PARAM
 *
          END 

Result

After the execution of the program, the changed TEST-GUA guard has the following contents:

:PUB1:$TESTUID.TEST-GUA
   User   ANNE
    Date      EX ( <2017-10-15,2017-11-15> )
   User   MARY
    Weekday   IN ( MO, TU, WE )
   User   PAUL
    Date      IN ( <2017-07-01,2017-09-30> )
   Group  REVIEWER
    Time      IN ( <09:00,15:00> )
    Date      IN ( <2017-08-23,2017-08-24> ,
                   <2017-09-09,2017-09-10> )
   Group  TEAMWORK
    Time      IN ( <09:00,15:00> )
    Date      IN ( <2017-08-23,2017-08-24> ,
                   <2017-09-09,2017-09-10> )
   Alluser
    Time      IN ( <07:00,19:00> )
    Weekday   EX ( SA, SU )