Z-DIS11A

This document covers the following topics:


Description

Display a list of documents.

This subprogram is similar to Z-DIS11X with the one exception that it also returns the parameter Replied.

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.

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 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.
  Replied A1   X An asterisk (*) indicates that a reply to a received item has been sent (Inbasket) or a reply to a sent item has been received (Outbasket). A question mark (?) indicates that a reply has been created but not yet been sent (Inbasket).
Work-parameter A49     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
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-749
Z-1200&0

Example

* Display a list of documents.
*
DEFINE DATA
LOCAL
1 RETURN-CODE           (N2)
1 CABINET               (A8)
1 PASSWORD              (A8)
1 FOLDER-NAME           (A15)
1 FILE-NAME             (A15)
1 FOLDER-NUMBER         (N5)
1 FILE-NUMBER           (N5)
1 SEQUENCE              (N1)
1 START-VALUE           (A32)
1 REDEFINE START-VALUE
  2 START-DATE          (A8)
1 NUMBER                (N2)
1 DOCUMENT-TABLE (20)
  2 ISN                 (P10)
  2 DOCUMENT-NAME       (A32)
  2 DESCRIPTION         (A60)
  2 DOCUMENT-FORMAT     (A1)
  2 STORED-IN-FILE      (A15)
  2 DATE-FILED          (N8)
  2 NAME-SENT-TO-BY     (A20)
  2 MAILCOUNT           (N7) 
  2 REPLIED             (A1)
1 WORK-PARAMETER        (A49)
1 #INDEX                (N2)
*
END-DEFINE
*
RESET RETURN-CODE
MOVE 'CABINET'  TO CABINET
MOVE 'PASSWORD' TO PASSWORD
MOVE 'Work'     TO FOLDER-NAME
MOVE 2          TO SEQUENCE
MOVE '20020202' TO START-DATE
MOVE 20         TO NUMBER
*
REPEAT UNTIL RETURN-CODE NE 0
*
  CALLNAT 'Z-DIS11A'
    RETURN-CODE
    CABINET
    PASSWORD
    FOLDER-NAME
    FILE-NAME
    FOLDER-NUMBER
    FILE-NUMBER
    SEQUENCE
    START-VALUE
    NUMBER
    DOCUMENT-TABLE(*)
    WORK-PARAMETER
*
  FOR #INDEX 1 TO NUMBER
    IF ISN(#INDEX) NE 0
      WRITE  NOTITLE (SG=OFF ZP=OFF AD=L)
        '=' #INDEX
        / 'Document name       ' DOCUMENT-NAME(#INDEX)
        / 'Description         ' DESCRIPTION(#INDEX) (AL=40)
        / 'Document format     ' DOCUMENT-FORMAT(#INDEX)
        / 'Stored in file      ' STORED-IN-FILE(#INDEX)
        / 'Date filed          ' DATE-FILED(#INDEX)
        / 'Name of the sender  ' NAME-SENT-TO-BY(#INDEX)
        / 'Number of addressees' MAILCOUNT(#INDEX)
        / 'Replied             ' REPLIED(#INDEX)
      NEWPAGE
    END-IF
  END-FOR
END-REPEAT
*
WRITE  'Return code ' RETURN-CODE
*
END