Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

Examples of GUARDS-SAVE

User PAUL has set up the following guards on his ID PAUL:

/show-guard-attributes

     Guard name         Scope   Type      Creation Date       LastMod Date 
------------------------------------------------------------------------------
:XXXX:$PAUL.STDAC        SYS  STDAC    2017-12-07/10:08:09 2017-12-07/10:09:25
                         Pauls Coowner Access Condition Guard 
:XXXX:$PAUL.SYS.UCF      SYS  COOWNERP 2017-12-07/10:08:54 2017-12-07/10:10:36
                         Pauls Coowner Rule Container Guard 
------------------------------------------------------------------------------
Guards selected: 2                                              End of display

/show-access-conditions

:XXXX:$PAUL.STDAC 
   User   SUSI     has ADMISSION 
------------------------------------------------------------------------------
Guards selected: 1                                              End of display

/show-coowner-protection-rule

------------------------------------------------------------------------------
RULE CONTAINER :XXXX:$PAUL.SYS.UCF                  ACTIVE  COOWNER PROTECTION
------------------------------------------------------------------------------
RULE1         OBJECT      = * 
              CONDITIONS  = $PAUL.STDAC
              TSOS-ACCESS = SYSTEM-STD 
------------------------------------------------------------------------------
RULE CONTAINER SELECTED: 1                                      END OF DISPLAY

User PAUL starts a GUARDS-SAVE session:

/start-guards-save


User PAUL wants to transfer his complete guards inventory into a backup file:

//backup-guards guard-name=*,backup-file-name=g-save

%  PRO7014 '2' GUARDS SAVED IN BACKUP FILE ':XXXX:$PAUL.G-SAVE' 
%******************************************************************************
%GUARDS-SAVE  BACKUP-GUARDS     Started by User  PAUL       2017-12-07/14:11:58
%                               ------------------------- 
%                               ***  Begin of Output  *** 
%******************************************************************************
%Backup File     : :XXXX:$PAUL.G-SAVE 
%Backup Date     : 2017-12-07/14:11:58 
%Backup Pubset   : XXXX 
% 
%Backup Guard    : :XXXX:$PAUL.* 
%Backup Type     : COOWNERP, DEFAULTP, DEFPATTR, DEFPUID , STDAC   , UNDEF 
%Backup Resolve  : *YES 
%******************************************************************************
%Saved  Guards   : 2 
%Faulty Guards   : 0 
%******************************************************************************
% 
%                  Alphabetical List of Saved and Faulty Guards 
% 
%==============================================================================
%Guard Name                Guard Type      Error    Status 
%----------                ----------      -----    ------ 
%:XXXX:$PAUL.STDAC         STDAC                    saved 
%:XXXX:$PAUL.SYS.UCF       COOWNERP                 saved 
%==============================================================================
% 
%                  Alphabetical List of Cross References 
% 
%==============================================================================
%:XXXX:$PAUL.SYS.UCF       COOWNERP    ->  :XXXX:$PAUL.STDAC         STDAC 
%-----------------------------------------------------------------------------%:XXXX:$PAUL.STDAC
         STDAC       <-  :XXXX:$PAUL.SYS.UCF       COOWNERP 
%==============================================================================
% 
%******************************************************************************
%GUARDS-SAVE  BACKUP-GUARDS     Started by User  PAUL       2017-12-07/14:11:58
%                               ------------------------- 
%                               ***   End of Output   *** 
%******************************************************************************


User PAUL has assured himself from the log that the backup was completed with any errors. The XREF list showed him that no references occur in his guards inventory to external guards that could possibly have made his backup incomplete.

Comment

To shorten the log, no RESOLVE is used in the following examples. In practice, RESOLVE should only be disabled if, for example, only rule containers are to be processed without the guards referenced by them.

User PAUL now starts a program-controlled restoration run with which he wants to transfer all of his saved guards back into the system:

//restore-guards guard-name=*,select=(resolve=*no),backup-file-name=g-save

%  PRO7021 '0' GUARDS RESTORED OUT OF BACKUP FILE ':XXXX:$PAUL.G-SAVE 
%******************************************************************************
%GUARDS-SAVE  RESTORE-GUARDS    Started by User  PAUL       2017-12-07/17:31:15
%                               ------------------------- 
%                                ***  Begin of Output  *** 
%******************************************************************************
%Backup File     : :XXXX:$PAUL.G-SAVE 
%Backup Date     : 2017-12-07/14:11:58 
%Backup Pubset   : XXXX 
%Backup Guards   : 2 
% 
%Restore Guard   : :XXXX:$PAUL.* 
%Restore Type    : COOWNERP, DEFAULTP, DEFPATTR, DEFPUID , STDAC   , UNDEF 
%Restore Resolve : *NO 
%Restore Replace : *NO
%Restore Target  : *SYSTEM 
% 
%New Pubset-Id   : *SAME 
%New User-Id     : *SAME 
%New Name        : *SAME 
%New Prog Pvs-Id : *SAME 
%******************************************************************************
%Restored Guards : 0 
%Faulty Guards   : 2 
%******************************************************************************
%
%                  Alphabetical List of Restored and Faulty Guards 
% 
%==============================================================================
%Guard Name                Guard Type      Error    Status 
%----------                ----------      -----    ------ 
%:XXXX:$PAUL.STDAC         STDAC           PRO1006  not restored or overwritten
%:XXXX:$PAUL.SYS.UCF       COOWNERP        PRO1006  not restored or overwritten
%==============================================================================
% 
%******************************************************************************
%GUARDS-SAVE  RESTORE-GUARDS    Started by User  PAUL       2017-12-07/17:31:15
%                               ------------------------- 
%                               ***   End of Output   *** 
%******************************************************************************


The program-controlled restoration run failed. To determine why no guards were restored, user PAUL executes a /HELP command on message number PRO1006:

//execute help pro1006

% PRO1006 GUARD '(&00)' ALREADY EXISTS. FUNCTION NOT PROCESSED

User PAUL now starts the run again and specifies that guards that already exist in the system are to be overwritten by the restoration:

//restore-guards guard-name=*, -
//               select=(resolve=*no), -
//               backup-file-name=g-save, -
//               replace-guard=*yes

%  PRO7021 '2' GUARDS RESTORED OUT OF BACKUP FILE ':XXXX:$PAUL.G-SAVE 
%******************************************************************************
%GUARDS-SAVE  RESTORE-GUARDS    Started by User  PAUL       2017-12-07/17:35:06
%                               ------------------------- 
%                               ***  Begin of Output  *** 
%******************************************************************************
%Backup File     : :XXXX:$PAUL.G-SAVE 
%Backup Date     : 2017-12-07/14:11:58 
%Backup Pubset   : XXXX 
%Backup Guards   : 2 
% 
%Restore Guard   : :XXXX:$PAUL.* 
%Restore Type    : COOWNERP, DEFAULTP, DEFPATTR, DEFPUID , STDAC   , UNDEF 
%Restore Resolve : *NO 
%Restore Replace : *YES
%Restore Target  : *SYSTEM 
% 
%New Pubset-Id   : *SAME 
%New User-Id     : *SAME 
%New Name        : *SAME 
%New Prog Pvs-Id : *SAME 
%******************************************************************************
%Restored Guards : 2 
%Faulty Guards   : 0 
%******************************************************************************
% 
%                  Alphabetical List of Restored and Faulty Guards 
% 
%==============================================================================
%Guard Name                Guard Type      Error    Status 
%----------                ----------      -----    ------ 
%:XXXX:$PAUL.STDAC         STDAC                    restored 
%:XXXX:$PAUL.SYS.UCF       COOWNERP                 restored 
%==============================================================================
% 
%******************************************************************************
%GUARDS-SAVE  RESTORE-GUARDS    Started by User  PAUL       2017-12-07/17:35:06
%                               ------------------------- 
%                               ***   End of Output   *** 
%******************************************************************************

User PAUL wants to make his guards inventory also available to his nonprivileged colleague MARY who works on pubset ZZZZ. User PAUL creates a command procedure for her, in which he renames the pubset from XXXX to ZZZZ and the user ID from PAUL to MARY. The procedure commands should be written such that none of the guards that exist for user MARY are overwritten.

//restore-guards guard-name=*, -
//               select=(resolve=*no), -
//               backup-file-name=g-save, -
//               new-path=(pubset-id=zzzz,user-id=mary), -
//               target=(proc-file-name=prc.mary,replace-proc-file=*yes)

%  PRO7021 '2' GUARDS RESTORED OUT OF BACKUP FILE ':XXXX:$PAUL.G-SAVE 
%******************************************************************************
%GUARDS-SAVE  RESTORE-GUARDS    Started by User  PAUL       2017-12-07/17:40:45
%                               ------------------------- 
%                               ***  Begin of Output  *** 
%******************************************************************************
%Backup File     : :XXXX:$PAUL.G-SAVE 
%Backup Date     : 2017-12-07/14:11:58 
%Backup Pubset   : XXXX 
%Backup Guards   : 2 
% 
%Restore Guard   : :XXXX:$PAUL.* 
%Restore Type    : COOWNERP, DEFAULTP, DEFPATTR, DEFPUID , STDAC   , UNDEF 
%Restore Resolve : *NO 
%Restore Replace : *NO 
%Restore Target  : $PAUL.PRC.MARY 
% 
%New Pubset-Id   : ZZZZ
%New User-Id     : MARY
%New Name        : *SAME 
%New Prog Pvs-Id : *SAME 
%******************************************************************************
%Generated Guards: 2 
%Faulty Guards   : 0 
%******************************************************************************
% 
%                  Alphabetical List of Restored and Faulty Guards 
% 
%==============================================================================
%Guard Name                Guard Type      Error    Status 
%----------                ----------      -----    ------ 
%:XXXX:$PAUL.STDAC         STDAC                    generated and path changed 
%:XXXX:$PAUL.SYS.UCF       COOWNERP                 generated and path changed 
%==============================================================================
% 
%******************************************************************************
%GUARDS-SAVE  RESTORE-GUARDS    Started by User  PAUL       2017-12-07/17:40:45
%                               ------------------------- 
%                               ***   End of Output   *** 
%******************************************************************************

User PAUL has finished and can end the GUARDS-SAVE session. He then displays the created procedure:

//end

/show-file PRC.MARY

/ BEGIN-PROCEDURE LOGGING=*NO 
/ 
/ REMARK MOD-JOB-OPT LOGGING=(LISTING=*YES) 
/ STEP 
/ ASSIGN-SYSLST TO=#RESTORE.LST.2017-12-07.174045 
/ STEP 
/ 
/ WRI-TEXT '*********************************************************' 
/ WRI-TEXT 'GUARDS-SAVE                                RESTORE-GUARDS' 
/ WRI-TEXT 'Proc Generated by User  PAUL      at  2017-12-07/17:40:45' 
/ WRI-TEXT '*********************************************************' 
/ WRI-TEXT '                  ***  Begin  ***                        ' 
/          "*********************************************************" 
/          "Backup File     : :XXXX:$PAUL.G-SAVE                     " 
/          "Backup Date     : 2017-12-07/14:11:58                    " 
/          "Backup Pubset   : XXXX                                   " 
/          "                                                         " 
/          "Restore Guard   : :XXXX:$PAUL.*                          " 
/          "Restore Type    : COOWNERP, DEFAULTP, DEFPATTR,          " 
/          "                  DEFPUID , STDAC   , UNDEF              " 
/          "Restore Resolve : *NO                                    " 
/          "Restore Replace : *NO                                    " 
/          "                                                         " 
/          "New Pubset-Id   : ZZZZ                                   "
/          "New User-Id     : MARY                                   "
/          "New Name        : *SAME                                  " 
/          "New Prog Pvs-Id : *SAME                                  " 
/          "*********************************************************" 
/          "** =================================================== **" 
/          "**                                                     **" 
/          "** Guard    :XXXX:$PAUL.STDAC         STDAC    0000001 **" 
/          "** -->      :ZZZZ:$MARY.STDAC                          **" 
/          "**                                                     **" 
/          "** =================================================== **" 
/           CRE-GUARD :ZZZZ:$MARY.STDAC                                - 
/              ,SCOPE=*HOST-SYSTEM                                     - 
/              ,USER-INFO='Pauls Coowner Access Condition Guard       ' 
/ WRI-TEXT '** :ZZZZ:$MARY.STDAC         STDAC     created         **' 
/           SKIP .R0000001 
/           STEP 
/ WRI-TEXT '** :ZZZZ:$MARY.STDAC         STDAC     create  *error* **' 
/           SKIP .E0000001 
/ 
/           .R0000001 
/           ADD-ACCESS-CONDITIONS :ZZZZ:$MARY.STDAC                    - 
/              ,SUBJECTS=*USER(USER-IDENTIFICATION=SUSI    )           - 
/              ,ADMISSION=*YES                                         - 
/              ,DIALOG-CONTROL=*NO 
/ WRI-TEXT '** :ZZZZ:$MARY.STDAC         STDAC     restored        **' 
/           SKIP .E0000001 
/           STEP 
/ WRI-TEXT '** :ZZZZ:$MARY.STDAC         STDAC     restore *error* **' 
/           SKIP .E0000001 
/           .E0000001 
/ 
/          "** =================================================== **" 
/          "**                                                     **" 
/          "** Guard    :XXXX:$PAUL.SYS.UCF       COOWNERP 0000002 **" 
/          "** -->      :ZZZZ:$MARY.SYS.UCF                        **" 
/          "**                                                     **" 
/          "** =================================================== **" 
/           CRE-GUARD :ZZZZ:$MARY.SYS.UCF                              - 
/              ,SCOPE=*HOST-SYSTEM                                     - 
/              ,USER-INFO='Pauls Coowner Rule Container Guard         ' 
/ WRI-TEXT '** :ZZZZ:$MARY.SYS.UCF       COOWNERP  created         **' 
/           SKIP .R0000002 
/           STEP 
/ WRI-TEXT '** :ZZZZ:$MARY.SYS.UCF       COOWNERP  create  *error* **' 
/           SKIP .E0000002 
/ 
/           .R0000002 
/           ADD-COOWNER-PROTECTION-RULE :ZZZZ:$MARY.SYS.UCF            - 
/              ,PROTECTION-RULE=RULE1                                  - 
/              ,RULE-POSITION=*LAST                                    - 
/              ,PROTECT-OBJECT=*PARAMETERS                             - 
/                (NAME=*                                               - 
/                ,CONDITION-GUARD=$MARY.STDAC                          
/                ,TSOS-ACCESS=*SYSTEM-STD)                             - 
/              ,GUARD-CHECK=*NO                                        - 
/              ,DIALOG-CONTROL=*NO 
/ WRI-TEXT '** :ZZZZ:$MARY.SYS.UCF       COOWNERP  restored        **' 
/           SKIP .E0000002 
/           STEP 
/ WRI-TEXT '** :ZZZZ:$MARY.SYS.UCF       COOWNERP  restore *error* **' 
/           SKIP .E0000002 
/ 
/           .E0000002 
/          "*********************************************************" 
/          "Guard Name                Guard Type Error   Status      " 
/          "----------                ---------- -----   ------      " 
/          ":XXXX:$PAUL.STDAC         STDAC              generated   " 
/          ":XXXX:$PAUL.SYS.UCF       COOWNERP           generated   " 
/          "---------------------------------------------------------" 
/          "Generated Guards: 2                                      " 
/          "Faulty Guards   : 0                                      " 
/          "*********************************************************" 
/ 
/ WRI-TEXT '*********************************************************' 
/ WRI-TEXT '                   ***  End  ***                         ' 
/ WRI-TEXT '*********************************************************' 
/ WRI-TEXT 'GUARDS-SAVE                                RESTORE-GUARDS' 
/ WRI-TEXT 'Proc Generated by User  PAUL      at  2017-12-07/17:40:45' 
/ WRI-TEXT '*********************************************************' 
/ 
/ STEP 
/ ASSIGN-SYSLST TO=*PRIMARY 
/ STEP 
/ 
/ END-PROCEDURE 


The next day, user MARY runs the procedure generated by user PAUL, under her ID:

/call-procedure $paul.prc.mary

*********************************************************
GUARDS-SAVE                                RESTORE-GUARDS
Proc Generated by User  PAUL      at  2017-12-07/17:40:45
*********************************************************
                  ***  Begin  *** 
*********************************************************
** :ZZZZ:$MARY.STDAC         STDAC     created         **
** :ZZZZ:$MARY.STDAC         STDAC     restored        **
** --------------------------------------------------- **
** :ZZZZ:$MARY.SYS.UCF       COOWNERP  created         **
** :ZZZZ:$MARY.SYS.UCF       COOWNERP  restored        **
*********************************************************
                  ***   End   *** 
*********************************************************
GUARDS-SAVE                                RESTORE-GUARDS
Proc Generated by User  PAUL      at  2017-12-07/17:40:45
*********************************************************


The following guards are now set up under the user ID of user MARY:

/show-guard-attributes

     Guard name         Scope   Type      Creation Date       LastMod Date 
------------------------------------------------------------------------------
:ZZZZ:$MARY.STDAC        SYS  STDAC    2017-12-08/08:28:09 2017-12-08/08:28:25
                         Pauls Coowner Access Condition Guard 
:ZZZZ:$MARY.SYS.UCF      SYS  COOWNERP 2017-12-08/08:28:54 2017-12-08/08:29:36
                         Pauls Coowner Rule Container Guard 
------------------------------------------------------------------------------
Guards selected: 2                                              End of display
/show-access-conditions
:ZZZZ:$MARY.STDAC 
   User   SUSI     has ADMISSION 
------------------------------------------------------------------------------
Guards selected: 1                                              End of display
/show-coowner-protection-rule
------------------------------------------------------------------------------
RULE CONTAINER :XXXX:$MARY.SYS.UCF                  ACTIVE  COOWNER PROTECTION
------------------------------------------------------------------------------
RULE1         OBJECT      = *
CONDITIONS  = $MARY.STDAC
              TSOS-ACCESS = SYSTEM-STD 
------------------------------------------------------------------------------
RULE CONTAINER SELECTED: 1                                      END OF DISPLAY