This document covers the following topics:
Display a list of users (not cabinets) including work address information.
You must specify either User-ID or User-name. You must not specify both. To display a list of all users, you can specify an asterisk (*). To display a list of all users starting with one or more specific letters, you can specify the letter(s) followed by an asterisk (for example, sm*).
The output in the Data-table is determined by the fields that you define - see the following table:
No. | Field | Format | Remarks |
---|---|---|---|
01 | User ID | A8 | |
02 | Last name | A32 | |
03 | First name | A32 | |
04 | Initial | A1 | |
05 | Title | A32 | |
06 | Company | A32 | |
07 | Location | A32 | |
08 | Address | A60 | Only the first line of the address lines. |
09 | City | A32 | |
10 | Country | A8 | |
11 | Department name | A32 | |
12 | Department number | A10 | |
13 | Phone | A15 | |
14 | Phone country code | A2 | |
15 | Phone extension | A5 | |
16 | Postal code | A10 | |
17 | State | A8 | The field to the right of "City" in the "Display User Address" screen. |
To define a field, you must specify its number in the parameter Fields. For example, when you define the field numbers 02, 03, 13 and 15, the last and first name of a user will be returned together with the phone number and extension.
The length of all specified fields must not exceed 200 bytes.
This subprogram should be invoked iteratively until the return code 77 indicates the end of the list.
Parameter | Format | In | Out | Remarks |
---|---|---|---|---|
Return-code | N2 | O | X | Input -1: no ET. |
Cabinet | A8 | R | Any user can invoke this subprogram. | |
Password | A8 | R | The password of the above cabinet. | |
User-ID | A8 | R* | Either User-ID or User-name, not both. | |
User-name | A32 | R* | Either User-name or User-ID, not both. | |
Number | N2 | O | The maximum number of users that are returned with each call. When you do not specify a value, or when you specify a value greater than 12, the default value 12 is used. | |
Fields | N2/1:17 | R | See the above table. | |
Data-table | A200/1:12 | X | The output in the Data-table is determined by the Fields you specified. | |
Work-parameter | A46 | For internal use. See The Work Parameter. |
00 | Success |
02 | Invalid cabinet name |
03 | Password incorrect |
77 | End of list |
90 | Data element in Data-table too large |
91 | Field was not defined |
92 | Supply either user name or user ID, not both |
93 | User name or user ID has not been specified |
Z-120
Z-122
Z-123
Z-1200&0
0010 DEFINE DATA 0020 * 0030 LOCAL 0040 * 0050 1 RETURN-CODE (N2) 0060 1 CABINET (A8) 0070 1 PASSWORD (A8) 0080 1 USER-ID (A8) 0090 1 USER-NAME (A32) 0100 1 NUMBER (N2) 0110 1 FIELDS (N2/1:17) INIT <1,2,3,13> 0120 1 DATA-TABLE (1:12) 0130 2 DATA-ELEMENT (A200) 0140 2 REDEFINE DATA-ELEMENT 0150 3 DE-USER-ID (A8) 0160 3 DE-LAST-NAME (A32) 0170 3 DE-FIRST-NAME (A32) 0180 3 DE-PHONE (A15) 0190 1 WORK-PARAMETER (A46) 0200 * 0210 1 #INDEX (P03) 0220 * 0230 END-DEFINE 0240 * 0250 INPUT (IP=OFF AD=A'_') 0260 'Cabinet ' CABINET 0270 / 'Password ' PASSWORD (AD=N) 0280 / 'Start with User ID' USER-ID 0290 * 0300 REPEAT 0310 CALLNAT 'Z-DIS33' 0320 RETURN-CODE 0330 CABINET 0340 PASSWORD 0350 USER-ID 0360 USER-NAME 0370 NUMBER 0380 FIELDS (*) 0390 DATA-TABLE (*) 0400 WORK-PARAMETER 0410 IF RETURN-CODE EQ 0 OR EQ 77 0420 WRITE NOTITLE 'List of phone numbers' / 0430 FOR #INDEX EQ 1 TO 12 0440 IF DE-USER-ID (#INDEX) NE ' ' 0450 WRITE NOTITLE 0460 DE-USER-ID (#INDEX) 0470 DE-LAST-NAME (#INDEX) 0480 DE-FIRST-NAME (#INDEX) (AL=20) 0490 DE-PHONE (#INDEX) 0400 END-IF 0510 END-FOR 0520 IF RETURN-CODE EQ 77 0530 WRITE NOTITLE / 'End of List' 0540 ELSE 0550 NEWPAGE 0560 END-IF 0570 ELSE 0580 WRITE NOTITLE 'Users could not be found:' RETURN-CODE 0590 END-IF 0600 UNTIL RETURN-CODE GT 0 0610 END-REPEAT 0620 * 0630 END