Z-DIS27

This document covers the following topics:


Description

Display a list of reference documents.

You can display either all reference documents of a cabinet in alphabetical order, or all reference documents of a folder/file in date order.

To display all reference 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.

Reference documents from the Wastebasket, Inbasket or Outbasket are displayed only, if the parameter Folder-name or Folder-number is specified.

Note:
If the Inbasket or folder number 1 is specified without entering a file number or file name, this subprogram returns the reference documents of all Inbasket files.

A reference document name can be specified in parameter Start-value for alphabetical order or user-defined sequence. A reference document date can be specified in parameter Start-value for ascending or descending date order.

The parameter Name-sent-to/by is only returned for reference documents that are stored in the Inbasket and Outbasket.

A complete list of reference 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.

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 of reference 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 reference 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 reference documents. If File-name is specified, Folder-name must also be specified. 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 reference 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 reference documents. If File-number is specified, Folder-number must also be specified. Either File-number or File-name, not both. See File Numbers.
Folder-sequence N1 O   1 (ascending by date), 2 (descending by date), or 3 (user-defined). Default: 1.
Start-value A32 O   Reference document name for alphabetical order or user-defined sequence. Reference document date (yyyymmdd) for ascending or descending date order in a folder/file.
Number N2 O   The maximum number of reference 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.
Reference-table (20)
  Reference-ISN P10   X The ISN of the reference document.
  Reference-name A32   X The name of the reference document.
  Description A60   X The first line of the description.
  Stored-in-folder A15   X The name of the folder in which the reference document is stored.
  Stored-in-file A15   X The name of the file in which the reference document is stored.
  Date-filed N8   X The date when the reference document was filed in this cabinet. When the reference 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 reference document is filed in the Inbasket, this is the name of the sender. When the reference document is filed in the Outbasket, this is the name of the first addressee.
  Mailcount N7   X When the reference 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.

Return Codes

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

Subprograms

Z-120
Z-122
Z-123
Z-147
Z-150
Z-175
Z-1200&0

Example

0010 *
0020 *  Display list of reference 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 FOLDER-SEQUENCE  (N1)
0140 1 START-VALUE      (A32)
0150 1 NUMBER           (N2)
0160 1 REFERENCE-TABLE(20)
0170   2 REFERENCE-ISN  (P10)
0180   2 REFERENCE-NAME (A32)
0190   2 DESCRIPTION    (A60)
0200   2 STORED-IN-FOLDER(A15)
0210   2 STORED-IN-FILE (A15)
0220   2 DATE-FILED     (N8)
0230   2 NAME-SENT-TO/BY(A20)
0240   2 MAILCOUNT      (N7)
0250 1 WORK-PARAMETER   (A49)
0260 1 INDEX            (N2)
0270 *
0280 END-DEFINE
0290 *
0300 MOVE   'CABINET'         TO  CABINET
0310 MOVE   'PASSWORD'        TO  PASSWORD
0320 MOVE   'WORK'            TO  FOLDER-NAME
0330 MOVE   '19961231'        TO  START-VALUE
0340 MOVE    20               TO  NUMBER
0350 *
0360 RESET RETURN-CODE
0370 REPEAT UNTIL RETURN-CODE NE 0
0380 *
0390 CALLNAT 'Z-DIS27'
0400   RETURN-CODE
0410   CABINET
0420   PASSWORD
0430   FOLDER-NAME
0440   FILE-NAME
0450   FOLDER-NUMBER
0460   FILE-NUMBER
0470   FOLDER-SEQUENCE
0480   START-VALUE
0490   NUMBER
0500   REFERENCE-TABLE (*)
0510   WORK-PARAMETER
0520 *
0530   FOR INDEX 1 TO 20
0540     IF REFERENCE-ISN(INDEX) EQ 0
0550       ESCAPE BOTTOM
0560     ELSE
0570       NEWPAGE
0580       WRITE(AD=L) INDEX                           //
0590         'ISN             ' REFERENCE-ISN(INDEX)   /
0600         'Reference name  ' REFERENCE-NAME(INDEX)  /
0610         'Description     ' DESCRIPTION(INDEX)     /
0620         'Stored in folder' STORED-IN-FOLDER(INDEX)/
0630         'Stored in file  ' STORED-IN-FILE(INDEX)  /
0640         'Date filed      ' DATE-FILED(INDEX)      /
0650         'Name sent to/by ' NAME-SENT-TO/BY(INDEX) /
0660         'Mailcount       ' MAILCOUNT(INDEX)       /
0670     END-IF
0680   END-FOR
0690 END-REPEAT
0700   WRITE  'Return code ' RETURN-CODE
0710 END