Z-COP11B

This document covers the following topics:


Description

Copy a document.

You can either store the copy in the same cabinet (as defined with the parameter Cabinet) or in another cabinet (as defined with the parameter Target-cabinet).

To copy a document to another cabinet, you can specify the password of that cabinet. When you do not specify a password, it is checked whether you are authorized to use this cabinet. When you specify a password, the password is checked.

Enclosures are copied with the document. Cover notes, attached notes, address lists, keywords and procedures are not copied. The security levels are reset to 0, and the private flag is reset to blank. The expiration date is calculated from the date the document is copied.

When you copy a document which is currently stored in the Inbasket file New, the corresponding address list is updated so that the reception status of the document indicates that it has been read. Additionally, the document is moved from the file New to file Opened. In this case, END TRANSACTION is automatically issued.

Parameters

Parameter Format In Out Remarks
Return-code N2 O X Input -1: no ET.
Cabinet A8 R   The cabinet which contains the document to be copied.
Password A8 R   The password of the above cabinet.
Document-name A32 R*   The name of the document to be copied. Either Document-name or ISN, not both.
ISN P8 R*   The ISN of the document to be copied. Either ISN or Document-name, not both. You can invoke Z-DIS11 prior to this subprogram to obtain the ISN for the desired document.
Target-cabinet A8 R   To store the copy in another cabinet, you must specify the ID of the target cabinet. To store the copy in the same cabinet, you must specify the same ID as in the Cabinet parameter.
Target-password A8 O   When the parameter Target-cabinet is specified and you are not authorized to use this cabinet, you must specify the password of the target cabinet. When you are authorized to use the target cabinet, the password is not required.
New-document-name A32 R   The name for the copy.
New-folder A15 O   The name of the folder in which the copy is to be stored. You must not specify a system folder (except Work). You can specify a TRS folder.
New-file A15 O   The name of a file within the above folder in which the copy is to be stored.
Description A60/1:4 O   A brief description for the copy.
Replace-flag A1 O   If marked, an existing document with the same name as specified in the parameter New-document-name is replaced with the copy.

Return Codes

00 Success
02 Invalid cabinet name or - in batch mode only - locked cabinet
03 Password incorrect
04 ISN was not found
06 TRS could not be invoked
08 Supply either ISN or name, not both
09 ISN does not point to correct object
10 Function not valid for a system folder
16 Document is locked - editing was not completed
51 Invalid name
52 Document with specified name already exists
53 Requested object does not exist
55 Requested folder/file does not exist

Subprograms

Z-GETMSM
Z-0211
Z-100
Z-106
Z-110
Z-120
Z-122
Z-123
Z-147
Z-150
Z-161
Z-165
Z-175
Z-177
Z-180
Z-185
Z-190
Z-191
Z-194
Z-194A
Z-197
Z-211
Z-222
Z-223
Z-373
Z-400
Z-401
Z-403
Z-404
Z-406
Z-407
Z-1200&0

Example

0010 DEFINE DATA
0020 LOCAL
0030 1 RETURN-CODE       (N2)
0040 1 CABINET           (A8)
0050 1 PASSWORD          (A8)
0060 1 DOCUMENT-NAME     (A32)
0070 1 ISN               (P8)
0080 1 TARGET-CABINET    (A8)
0090 1 TARGET-PASSWORD   (A8)
0100 1 NEW-DOCUMENT-NAME (A32)
0110 1 NEW-FOLDER        (A15)
0120 1 NEW-FILE          (A15)
0130 1 DESCRIPTION       (A60/1:4)
0140 1 REPLACE-FLAG      (A1)
0150 END-DEFINE
0160 *
0170 MOVE 'LS'               TO CABINET
0180 MOVE 'LSPSW'            TO PASSWORD
0190 MOVE 'DOCUMENT-NAME'    TO DOCUMENT-NAME
0200 MOVE 'ESH'              TO TARGET-CABINET
0210 MOVE 'ESHPSW'           TO TARGET-PASSWORD
0220 MOVE 'NEW-DOC-NAME'     TO NEW-DOCUMENT-NAME
0230 MOVE 'Subject of new document' TO DESCRIPTION(1)
0240 *
0250 CALLNAT 'Z-COP11B' RETURN-CODE CABINET PASSWORD DOCUMENT-NAME
0260          ISN TARGET-CABINET TARGET-PASSWORD NEW-DOCUMENT-NAME
0270          NEW-FOLDER NEW-FILE DESCRIPTION(*) REPLACE-FLAG
0280 *
0290 IF RETURN-CODE NE 0
0300   WRITE 'Return code' RETURN-CODE
0310 ELSE
0320   WRITE 'Document was copied'
0330 END-IF
0340 END