Z-COP11

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). You can only copy a document to another cabinet when you are authorized to use this cabinet - therefore the password of the target cabinet is not required.

To copy a document to another cabinet of which you know the password, you can use Z-COP11B.

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.
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 NEW-DOCUMENT-NAME  (A32)
0100 1 NEW-FOLDER         (A15)
0110 1 NEW-FILE           (A15)
0120 1 DESCRIPTION        (A60/1:4)
0130 1 REPLACE-FLAG       (A1)
0140 END-DEFINE
0150 *
0160 MOVE 'LS'              TO CABINET
0170 MOVE 'PSW'             TO PASSWORD
0180 MOVE 'DOCUMENT-NAME'   TO DOCUMENT-NAME
0190 MOVE 'ESH'             TO TARGET-CABINET
0200 MOVE 'NEW-DOC-NAME'    TO NEW-DOCUMENT-NAME
0210 MOVE 'Subject of new document' TO DESCRIPTION(1)
0220 *
0230 CALLNAT 'Z-COP11' RETURN-CODE CABINET PASSWORD DOCUMENT-NAME
0240   ISN TARGET-CABINET NEW-DOCUMENT-NAME NEW-FOLDER NEW-FILE
0250   DESCRIPTION(*) REPLACE-FLAG
0260 *
0270 IF RETURN-CODE NE 0
0280    WRITE  'Return code' RETURN-CODE
0290 ELSE
0300    WRITE 'Document was copied'
0310 END-IF
0320 END
0330 *