Z-ADD05

This document covers the following topics:


Description

Add a cabinet.

This subprogram can be used only by a supervisor or cabinet administrator.

The cabinet and user profile which has been specified for the cabinet SYSCNT is automatically copied to the new cabinet. Administrator status is not copied to the new cabinet.

Successful termination of Z-ADD05 always results in an END TRANSACTION. You are not able to control transaction handling.

Note:
If modifications to the cabinet are necessary, use one of the Z-MOD05 subprograms with the ISN returned by Z-ADD05 or the Cabinet-name you specified with Z-ADD05. Z-MOD05A through Z-MOD05E modify different features of the user profile while Z-MOD05F modifies the cabinet profile.

Parameters

Parameter Format In Out Remarks
Return-code N2   X  
Cabinet A8 R   The cabinet ID of a supervisor or cabinet administrator.
Password A8 R   The password of the above cabinet.
Cabinet-name A8 R   The name of the cabinet to be added.
Cabinet-type N1 R   0=private cabinet, 1=standalone cabinet, 2=shared cabinet, 3=public cabinet.
Last-name A32 R   If the cabinet type is 0, you must enter the last name of the cabinet user. If the cabinet type is 1, 2 or 3, you must enter a description for the cabinet.
First-name A32 R   Only required for cabinet type 0. You must enter the first name of the cabinet user.
Initial A1 O   Can only be used with cabinet type 0. The middle initial of the cabinet user.
Disallow-mail A1 O   Can only be used with cabinet types 1, 2 and 3. If marked, the cabinet is not able to receive or send mail.
ISN P8   X The ISN of the new cabinet.

Return Codes

00 Success
02 Invalid cabinet name or - in batch mode only - locked cabinet
03 Password incorrect
15 Invalid administrator status
51 Invalid name
52 Object with specified name already exists
91 Cabinet type not specified
92 Disallow-mail is allowed only for cabinet type 1 to 3
94 Enter an alphabetical character value for Disallow-mail
95 Enter Last-name and First-name for private cabinet
96 First-name and Initial are defined only for private cabinet
97 Enter description in Last-name for cabinet type 1 to 3
98 Cabinet-name specified is reserved for rename

Subprograms

Z-109
Z-112
Z-120
Z-122
Z-123
Z-175
Z-190
Z-195
Z-206
Z-720
Z-1200&0

Example

The following example uses two local data areas. See Local Data Areas for further information.

Note the prefixes "L-ADD05." and "L-DIS05." which uniquely identify the parameters.

DEFINE DATA
LOCAL USING L-ADD05
LOCAL USING L-DIS05
LOCAL
1 INDEX (N2)
END-DEFINE
*
RESET L-ADD05.RETURN-CODE
MOVE 'DBA'         TO L-ADD05.CABINET
MOVE 'DBA'         TO L-ADD05.PASSWORD
MOVE 'FBL'         TO L-ADD05.CABINET-NAME
MOVE 0             TO L-ADD05.CABINET-TYPE
MOVE 'BLUECHAIR'   TO L-ADD05.LAST-NAME
MOVE 'FUV'         TO L-ADD05.FIRST-NAME
MOVE 'A'           TO L-ADD05.INITIAL
*
CALLNAT 'Z-ADD05'
    L-ADD05
IF L-ADD05.RETURN-CODE = 0
  WRITE 'Cabinet was added'
ELSE
  WRITE 'Return code' L-ADD05.RETURN-CODE
END-IF
*
NEWPAGE
*
RESET L-DIS05.RETURN-CODE
MOVE 'DBA'       TO  L-DIS05.CABINET
MOVE 'DBA'       TO  L-DIS05.PASSWORD
MOVE 'FBL'       TO  L-DIS05.START-CABINET
MOVE  9          TO  L-DIS05.START-CABINET-TYPE
MOVE  20         TO  L-DIS05.NUMBER
*
REPEAT UNTIL L-DIS05.RETURN-CODE NE 0
*
  CALLNAT 'Z-DIS05'
    L-DIS05
*
  FOR INDEX 1 TO L-DIS05.NUMBER
    IF L-DIS05.CABINET-ISN(INDEX) NE 0
      WRITE  NOTITLE (SG=OFF ZP=OFF AD=L )
           'Cabinet name   '  L-DIS05.CABINET-NAME(INDEX)
        /  'Cabinet type   '  L-DIS05.CABINET-TYPE(INDEX)
        /  'User last name '  L-DIS05.USER-LAST-NAME(INDEX)
        /  'User first name'  L-DIS05.USER-FIRST-NAME(INDEX)
        /  'User initial   '  L-DIS05.USER-INITIAL(INDEX)
        /  'Disallow mail  '  L-DIS05.DISALLOW-MAIL(INDEX)
        /  'Owner          '  L-DIS05.OWNER(INDEX)
        /  'Administrator  '  L-DIS05.ADMINISTRATOR(INDEX)
        /  'Cabinet ISN    '  L-DIS05.CABINET-ISN(INDEX)
     NEWPAGE
    END-IF
  END-FOR
END-REPEAT
WRITE 'Return code ' L-DIS05.RETURN-CODE
*
END