Z-DIS17A

This document covers the following topics:


Description

Display a list of all members of a distribution list, a shared cabinet or a private cabinet which the user has shared.

When you specify neither the parameter Start-name nor Start-ID, the members are returned alphabetically in ID sequence.

When you specify a start value in the parameter Start-name, only users are returned. In this case, the list is sorted alphabetically by last name.

When you specify a start value in the parameter Start-ID, all member types are returned. In this case, the list is sorted alphabetically by ID.

This subprogram checks first whether the distribution list exists in the specified cabinet. (In the case of a private cabinet, this subprogram then checks whether members exist for the cabinet). If a distribution list is not found, this subprogram then checks whether a distribution list of that name exists in cabinet SYSCNT.

This subprogram should be invoked iteratively until the return code 77 indicates the end of the list.

Parameters

Parameter Format In Out Remarks
Return-code N2 O X Input -1: no ET.
Cabinet A8 R   The name of the cabinet in which you want to display the list.
Password A8 R   The password of the above cabinet.
Distribution-name A32 R   The name of a distribution list or the ID of a cabinet for which you want to display the members.
Start-name A20 O*   Start value. See the description above. Either Start-name or Start-ID, not both.
Start-ID A16 O*   Start value. See the description above. Either Start-ID or Start-name, not both.
List-type A1   X 1=distribution list, 2=cabinet.
Member-array (20)
  Name A20   X The name of the member.
  Mail-ID A16   X The ID of the member.
  Member-type A1   X 1=distribution, 2=cabinet, 3=user, 4=bulletin, 5=external.
  Mail-type A1   X The type of mail which the member of the distribution list receives: O=original, C=copy, B=blindcopy.
Work-parameter A32     For internal use. See The Work Parameter.

Return Codes

00 Success
02 Invalid cabinet name or - in batch mode only - locked cabinet
03 Password incorrect
30 Distribution list name invalid
31 No members found
77 End of list
90 Specify either Start-ID or Start-name - you must not specify both

Subprograms

Z-120
Z-122
Z-123
Z-147
Z-165
Z-1200&0

Example

0010 *
0020 * Return a list of all members of a distribution list, shared cabinet
0030 * or private cabinet
0040 *
0050 DEFINE DATA
0060 LOCAL
0070 1 RETURN-CODE       (N2)
0080 1 CABINET           (A8)
0090 1 PASSWORD          (A8)
0100 1 DISTRIBUTION-NAME (A32)
0110 1 START-NAME        (A20)  /* list only users - not other objects!
0120 1 START-ID          (A16)  /* list all objects by ID!
0130 1 LIST-TYPE         (A1)
0140 1 MEMBER-ARRAY      (20)
0150   2 NAME            (A20)
0160   2 MAIL-ID         (A16)
0170   2 MEMBER-TYPE     (A1)  /* user,distribution,cabinet,bulletin,external
0180   2 MAIL-TYPE       (A1)  /* 'O': original 'C': copy, 'B': blindcopy
0190 1 WORK-PARAMETER    (A32)
0200 *
0210 END-DEFINE
0220 *************************************
0230 *
0240 MOVE 'CABINET'    TO CABINET
0250 MOVE 'PASSWORD'   TO PASSWORD
0260 MOVE 'NAME'       TO DISTRIBUTION-NAME /* distribution list/shared cabinet
0270 MOVE 'USER-ID'    TO START-ID          /* to sort by ID
0280 *
0290 CALLNAT 'Z-DIS17A'
0300     RETURN-CODE
0310     CABINET
0320     PASSWORD
0330     DISTRIBUTION-NAME
0340     START-NAME
0350     START-ID
0360     LIST-TYPE
0370     MEMBER-ARRAY  (*)
0380     WORK-PARAMETER
0390 *
0400 IF RETURN-CODE EQ 0
0410    WRITE NAME(*) MAIL-ID(*) MEMBER-TYPE(*) MAIL-TYPE(*)
0420 ELSE
0430    WRITE 'RETURN CODE ' RETURN-CODE
0440 END-IF
0450 END