Z-DIS39A

This document covers the following topics:


Description

Display a list of all addressees to whom the user of a specific cabinet can send mail.

If Address-type 0 (all) is chosen, Address-type 33 (user ID) is not considered, because the information is returned with Address-type 70 (name).

If Address-type 33 (user ID) or 70 (name) is chosen, this subprogram returns Last-name, First-name, Initial, Title and information about the work address.

If either Address-type 1 (address) or 0 (all) is chosen for a nickname that does not refer to a Con-nect user (e.g. the phone number of your doctor), this subprogram does not return addressees. In this case, only the parameter Last-name is filled with the nickname.

This subprogram performs the following checks:

  • if the selected Address-type is 74 (external) and the cabinet from which this subprogram was invoked cannot use external mailing facilities, return code 77 is issued; in this case no addresses are returned;

  • if the selected address has a send level greater than that of the cabinet from which this subprogram was invoked, the selected address is not returned.

This subprogram should be invoked iteratively until the return code 77 indicates the end of the list. In this case, the Work-parameter contains the needed information. The parameters cannot be modified.

Note:
This subprogram does not return members of a distribution list - this function is supported by Z-DIS17A and Z-DIS17B.

Parameters

Parameter Format In Out Remarks
Return-code N2 O X Input -1: no ET
Cabinet A8 R   The cabinet for which you want to display the list.
Password A8 R   The password of the above cabinet.
Start-name A19 O   The name of an addressee. If a start value is not specified or an asterisk (*) is specified, the search starts at the first possible value. This subprogram first searches for the address records in the specified cabinet and then in cabinet SYSCNT.
Number N2 O   The maximum number of addressees that are returned with each call. When you do not specify a value, or when you specify a value greater than 20, the default value 20 is used.
Address-type N2 R   Must be one of the following: 1=Address (nickname), 4=Bulletin, 5=Cabinet, 10=Distribution, 33=User ID, 70=Name, 74=External, 0=All. All other values are handled as 0.
Address-table (20)
  Returned-address-type N2   X See Address Types.
  Mail-ID A8   X The ID of the addressee.
  Last-name A32   X The addressee's last name.
  First-name A32   X The addressee's first name.
  Initial A1   X The addressee's initial.
  Title A32   X Part of the addressee's work address.
  Company A32   X Part of the addressee's work address.
  Department-name A32   X Part of the addressee's work address.
  Department-number A10   X Part of the addressee's work address.
  Work-address A60/1:3   X Part of the addressee's work address.
  Work-city A32   X Part of the addressee's work address.
  Work-postal-code A10   X Part of the addressee's work address.
  Work-phone A15   X Part of the addressee's work address.
  Work-extension A10   X Part of the addressee's work address.
Work-parameter A54     For internal use. See The Work Parameter.

Return Codes

00 Success
02 Invalid cabinet name
03 Password incorrect
77 End of list

Subprograms

Z-120
Z-122
Z-211
Z-1200&0

Example

0010 * Display address list entries
0020 *
0030 DEFINE DATA
0040 LOCAL
0050 1 RETURN-CODE      (N2)
0060 1 CABINET          (A8)
0070 1 PASSWORD         (A8)
0080 1 START-NAME       (A19)
0090 1 NUMBER           (N2)
0100 1 ADDRESS-TYPE     (N2)
0110 1 ADDRESS-TABLE    (20)     /* Redefinition see parameter list
0120 1 WORK-PARAMETER   (A54)
0130 1 INDEX            (N2)
0140 END-DEFINE
0150 *
0160 MOVE 'CABINET'     TO CABINET
0170 MOVE 'PASSWORD'    TO PASSWORD
0180 MOVE 'START-NAME'  TO START-NAME
0190 MOVE  0            TO ADDRESS-TYPE
0200 *
0210 CALLNAT 'Z-DIS39A'
0220 *
0230 IF RETURN-CODE EQ 0 OR EQ 77
0240    FOR INDEX 1 TO 20
0250         WRITE ADDRESS-TABLE(INDEX)
0260    END-FOR
0270 ELSE
0280    WRITE 'Return code:' RETURN-CODE
0290 END-IF
0300 END