This document covers the following topics:
Copy a document.
You can specify whether keywords and enclosures are to be copied with the document or not.
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.
Cover notes, attached notes, address lists 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.
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. | |
Keyword-flag | A1 | O | If marked, the keywords are copied with the document. | |
Enclosure-flag | A1 | O | If marked, the enclosures are copied with the document. |
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 |
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
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 1 KEYWORD-FLAG (A1) 0160 1 ENCLOSURE-FLAG (A1) 0170 END-DEFINE 0180 * 0190 MOVE 'X' TO REPLACE-FLAG 0200 MOVE 'X' TO KEYWORD-FLAG 0210 MOVE 'X' TO ENCLOSURE-FLAG 0220 * 0230 MOVE -1 TO RETURN-CODE 0240 MOVE 'LS ' TO CABINET 0250 MOVE ' ' TO PASSWORD 0260 * 0270 MOVE 'ESH ' TO TARGET-CABINET 0280 MOVE ' ' TO TARGET-PASSWORD 0290 * 0300 MOVE 'Sharks' TO DOCUMENT-NAME 0310 MOVE 'Work' TO NEW-FOLDER 0320 MOVE 'Sharks-Copy' TO NEW-DOCUMENT-NAME 0330 COMPRESS 'Created ' *DATX *TIMX 'using Z-COP11C' 0340 INTO DESCRIPTION (1) 0350 * 0360 * 0370 CALLNAT 'Z-COP11C' 0380 RETURN-CODE 0390 CABINET 0400 PASSWORD 0410 DOCUMENT-NAME 0420 ISN 0430 TARGET-CABINET 0440 TARGET-PASSWORD 0450 NEW-DOCUMENT-NAME 0460 NEW-FOLDER 0470 NEW-FILE 0480 DESCRIPTION (*) 0490 REPLACE-FLAG 0500 KEYWORD-FLAG 0510 ENCLOSURE-FLAG 0520 * 0530 WRITE 0540 '=' RETURN-CODE // 0550 'O L D' / 0560 '=====' / 0570 'Cabinet :' CABINET 0580 'Password:' PASSWORD / 0590 'Name :' DOCUMENT-NAME / 0600 'ISN :' ISN // 0610 'N E W' / 0620 '=====' / 0630 'Cabinet :' TARGET-CABINET 0640 'Password:' TARGET-PASSWORD / 0650 'Name :' NEW-DOCUMENT-NAME / 0660 'Folder :' NEW-FOLDER / 0670 'Descrip.:' DESCRIPTION (*) // 0680 '=' REPLACE-FLAG 0690 '=' KEYWORD-FLAG 0700 '=' ENCLOSURE-FLAG 0710 * 0720 IF RETURN-CODE EQ 0 0730 BACKOUT TRANSACTION /* do not save copy 0740 END-IF 0750 * 0760 END