This document covers the following topics:
Display a list of documents.
This subprogram is the same as Z-DIS11 with the exception that the parameter ISN uses the format P10 and that descending order can be specified for displaying all documents of a cabinet.
You can display either all documents of a cabinet in alphabetical order (ascending or descending), or all documents of a folder/file in date order (ascending, descending or user-defined sequence).
To display all documents of a cabinet, you must not specify a folder or file.
Folders and files can be specified either by their numbers or by their names. You must not specify both.
Note:
You can invoke Z-DIS13 prior
to this subprogram to return the number of a user-defined folder.
Documents from the Wastebasket, Inbasket or Outbasket are displayed only, if the parameter Folder-name or Folder-number is specified.
A document name can be specified as the Start-value for alphabetical order or user-defined sequence. A document date can be specified as the Start-value for ascending or descending date order.
A complete list of documents is returned if this subprogram is invoked iteratively. In this case, the parameters cannot be modified once this subprogram has been invoked. If this subprogram is invoked iteratively, the Work-parameter contains the needed restart values.
The parameter Name-sent-to/by is only returned for reference documents that are stored in the Inbasket and Outbasket.
Note:
If the Inbasket or Folder-number 1 is specified without entering a
File-number or File-name, this subprogram returns the documents of all Inbasket
files.
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 of documents. | |
Password | A8 | R | The password of the above cabinet. | |
Folder-name | A15 | O* | The name of the folder from which you want to display the list of documents. Either Folder-name or Folder-number, not both. | |
File-name | A15 | O* | The name of the file from which you want to display the list of documents. Either File-name or File-number, not both. | |
Folder-number | N5 | O* | The number of the folder from which you want to display the list of documents. Either Folder-number or Folder-name, not both. See Folder Numbers. | |
File-number | N5 | O* | The number of the file from which you want to display the list of documents. Either File-number or File-name, not both. See File Numbers. | |
Sequence | N1 | O | If one of the folder/file parameters has been specified: 1 (ascending by date), 2 (descending by date), or 3 (user-defined). If none of the folder/file parameters has been specified: 1 (ascending by name), or 2 (descending by name). Default: 1. | |
Start-value | A32 | O | Document name for alphabetical order or user-defined sequence. Document date (yyyymmdd) for ascending or descending date order in a folder/file. | |
Number | N2 | O | The maximum number of documents 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. | |
Document-table (20) | ||||
ISN | P10 | X | The ISN of the document. | |
Document-name | A32 | X | The name of the document. | |
Description | A60 | X | The first line of the description. | |
Document-format | A1 | X | See Document Formats. | |
Stored-in-file | A15 | X | The name of the file in which the document is stored. | |
Date-filed | N8 | X | The date when the document was filed in this cabinet. When the document is filed in the Inbasket or Outbasket, this is the date when the item was sent. | |
Name-sent-to/by | A20 | X | When the document is filed in the Inbasket, this is the name of the sender. When the document is filed in the Outbasket, this is the name of the first addressee. | |
Mailcount | N7 | X | When the document is filed in the Outbasket, this is the number of addressees to whom the item was sent. | |
Work-parameter | A49 | For internal use. See The Work Parameter. |
00 | Success |
02 | Invalid cabinet name |
03 | Password incorrect |
11 | Supply folder/file name or number, not both |
55 | Requested folder/file does not exist |
73 | Invalid folder/file name |
77 | End of list |
Z-120
Z-122
Z-123
Z-147
Z-150
Z-175
Z-1200&0
0010 * 0020 * Example program to display a list of documents. 0030 * 0040 DEFINE DATA 0050 LOCAL 0060 1 RETURN-CODE (N2) 0070 1 CABINET (A8) 0080 1 PASSWORD (A8) 0090 1 FOLDER-NAME (A15) 0100 1 FILE-NAME (A15) 0110 1 FOLDER-NUMBER (N5) 0120 1 FILE-NUMBER (N5) 0130 1 SEQUENCE (N1) 0140 1 START-VALUE (A32) 0150 1 REDEFINE START-VALUE 0160 2 START-DATE (A8) 0170 1 NUMBER (N2) 0180 1 DOCUMENT-TABLE (20) 0190 2 ISN (P10) 0200 2 DOCUMENT-NAME (A32) 0210 2 DESCRIPTION (A60) 0220 2 DOCUMENT-FORMAT (A1) 0230 2 STORED-IN-FILE (A15) 0240 2 DATE-FILED (N8) 0250 2 NAME-SENT-TO-BY (A20) 0260 2 MAILCOUNT (N7) 0270 1 WORK-PARAMETER (A49) 0280 1 #INDEX (N2) 0290 * 0300 END-DEFINE 0310 * 0320 RESET RETURN-CODE 0330 MOVE 'CABINET' TO CABINET 0340 MOVE 'PASSWORD' TO PASSWORD 0350 MOVE 'Work' TO FOLDER-NAME 0360 MOVE 2 TO SEQUENCE 0370 MOVE '20000805' TO START-DATE 0380 MOVE 20 TO NUMBER 0390 * 0400 REPEAT UNTIL RETURN-CODE NE 0 0410 * 0420 CALLNAT 'Z-DIS11X' 0430 RETURN-CODE 0440 CABINET 0450 PASSWORD 0460 FOLDER-NAME 0470 FILE-NAME 0480 FOLDER-NUMBER 0490 FILE-NUMBER 0500 SEQUENCE 0510 START-VALUE 0520 NUMBER 0530 DOCUMENT-TABLE(*) 0540 WORK-PARAMETER 0550 * 0560 FOR #INDEX 1 TO NUMBER 0570 IF ISN(#INDEX) NE 0 0580 WRITE NOTITLE (SG=OFF ZP=OFF AD=L) 0590 '=' #INDEX 0600 / 'Document name ' DOCUMENT-NAME(#INDEX) 0610 / 'Description ' DESCRIPTION(#INDEX) (AL=40) 0620 / 'Document format ' DOCUMENT-FORMAT(#INDEX) 0630 / 'Stored in file ' STORED-IN-FILE(#INDEX) 0640 / 'Date filed ' DATE-FILED(#INDEX) 0650 / 'Name of the sender ' NAME-SENT-TO-BY(#INDEX) 0660 / 'Number of addressees' MAILCOUNT(#INDEX) 0670 NEWPAGE 0680 END-IF 0690 END-FOR 0700 END-REPEAT 0710 * 0720 WRITE 'Return code ' RETURN-CODE 0730 * 0740 END