Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

COPY - Copy message unit

&pagelevel(5)&pagelevel

Function

The //COPY statement copies message units, with or without the associated documentation lines, from one message file to another or to a different location within the same message file. The copying procedure does not change the message unit in the source file.

Each message unit is identified by means of its message code. It is possible to copy more than one message unit at a time by specifying a message class or message range in the MSG-ID operand. If the value *DOCUMENTATION is specified in the INFORMATION operand, the documentation lines defined in the specified message range are copied.

If the source file for the copying procedure is identical to the target file, new message codes must be defined in the TO-MSG-ID operand.
It is possible to copy message units between any two message files, irrespective of the file that is currently open. The FROM-FILE and TO-FILE operands permit access to these files; the current message file remains open and, if it is neither the source file nor the target file, is not changed.

If languages are specified explicitly in the INFORMATION=*MESSAGES(...) operand, only the texts (message, meaning and response) in these languages are copied to the target message unit. If the target unit does not exist, it is created with the message attributes (access methods, output destination, ...) of the source message unit.

If the target message unit already contains a text with the same message code and language identifier, the text of the target message unit is overwritten with the text of the source message unit.
If this occurs in interactive mode, an error message is issued asking the user whether or not the existing message unit is to be overwritten.
In batch jobs and procedures, the specified message file components are not copied and processing is continued, unless OVERWRITE=*YES was specified in the //COPY or //MODIFY-OPTION statement.

If the only difference between the texts is the language identifier, the text is appended to the contents of the target message unit.

If the entire contents of a message file are to be copied to another file, the //MERGE-MSG-FILES statement should be used rather than the //COPY statement (see the //MERGE-MSG-FILES statement on page "MERGE-MSG-FILES Merge message files").
Differences compared with the //COPY statement in menu mode

The //COPY statement that can be entered in the command area of the screen mask differs from the //COPY statement in command procedures in that

  • in menu mode, the operand value *PANEL-REQUEST can be assigned to any operand

  • an additional value can be specified for the MSG-ID operand

  • the OVERWRITE operand is not available in menu mode.

For further details, see section “Special features of statements in menu mode”.

 

Format

COPY                                                                                                                                                            

MSG-ID = *ALL / *CLASS(...) / *INTERVAL(...) / list-poss(2000): <name 7..7>


*CLASS(...)



|

MSG-CLASS = <name 3..3>


*INTERVAL(...)



|

FROM = <name 7..7>



|

,TO = <name 7..7>

,INFORMATION = *MESSAGES (...) / *ALL / list-poss(4): *DOCUMENTATION / *COMPONENT-ID /




*CORRECTION-INFO / *MESSAGES(...)


*MESSAGES(...)



|

LANGUAGES = *ALL / list-poss(8): <name 1..1>

,FROM-FILE = *CURRENT / <filename 1..54>

,TO-MSG-ID = *SAME / *CLASS(...) / <alphanum-name 4..7 with-wild>


*CLASS(...)



|

MSG-CLASS = <name 3..3>

,TO-FILE = *CURRENT / <filename 1..54> (...)


<filename 1..54>(...)



|

,FILE-FORMAT = *NEW / *OLD

1)

,OVERWRITE = *STD / *YES / *NO

1)  The FILE-FORMAT operand is obsolete. It can still be specified for reasons of compatibility.

Operands

MSG-ID = *ALL / *CLASS(...) / *INTERVAL(...) / list-poss(2000): <name 7..7>
Specifies the message code of one or more message units of the opened message file that are to be copied.
If INFORMATION = *DOCUMENTATION is specified, the documentation lines defined for the message codes are also copied.

MSG-ID = *ALL
All the message components defined in the INFORMATION operand are copied. In this case, the TO-MSG-ID operand must be assigned the value *SAME.

MSG-ID = *CLASS(...)
All components of the messages in the specified message classes are copied.

MSG-CLASS = <name 3..3>
Specifies the 3-letter message class.

 

MSG-ID = *INTERVAL(...)
All components of the messages within the specified message range are copied.
If the message range contains more than one message class, the value *SAME must be assigned to the TO-MSG-ID operand.

FROM = <name 7..7>
Specifies the first message code of the message range.

TO = <name 7..7>
The full seven-character message code must be specified.

MSG-ID = list-poss(2000): <name 7..7>
Specifies the full seven-character message code. If a list of message codes is specified, the TO-MSG-ID operand must be assigned the value *SAME.

INFORMATION = *MESSAGES(...) / *ALL / list-poss(3): *MESSAGES(...) / *DOCUMENTATION / *CORRECTION-INFO / *COMPONENT-ID
Specifies the message file components to be copied.

INFORMATION = *MESSAGES(...)
Specifies message units to be copied. The message units are selected via the MSG-ID operand.

LANGUAGES = *ALL / list-poss(8): <name 1..1>
Specifies the language identifiers. Message, meaning and response texts in these languages are copied.

LANGUAGES = *ALL
The entire message unit is copied, including all message attributes, inserts, insert attributes and texts.

LANGUAGES = list-poss(8): <name 1..1>
Message texts and/or meaning and response texts in the selected language(s) are copied. The message attributes and insert attributes of the source message unit are only copied if the target message unit does not already exist. Otherwise the following the message MSME108 is output.

INFORMATION = *ALL
All message file components (message units and documentation lines) are copied. If MSG-ID = *ALL is specified, all the contents of the message file are copied.

INFORMATION = *DOCUMENTATION
All documentation lines whose message codes are within the selected range (MSG-ID operand) are copied. If other defined message ranges overlap the specified message range, their documentation lines are also copied.

Example

MSG-ID = *INTERVAL (TST1500-TST1599).
The documentation lines of the message ranges (TST1500-TST1510), (TST1000-TST1999), (TST1000-TST1500), TST1510, ... are copied.

INFORMATION = *CORRECTION-INFO / *COMPONENT-ID
These operands are reserved for internal use with the manufacturer.

FROM-FILE = *CURRENT / <filename 1..54>
Name of the message file from which the specified components (MSG-ID operand) are to be copied.
The operand value *CURRENT refers to the current message file, i.e. the message file last opened using the //OPEN-MSG-FILE statement.

 

TO-MSG-ID = *SAME / *CLASS(...) / <alphanum-name 4..7 with-wild>
Specifies the new message codes of the copied message components in the target area.

TO-MSG-ID = *SAME
When copied, the message components retain their original message code.
The value *SAME must not be specified if message components are being copied to another location within the same file. The value *SAME must be specified if the MSG-ID operand is assigned a list of message codes, the value *ALL or message codes from more than one message class.

TO-MSG-ID = *CLASS(...)
Specifies a new message class for the copied message components. The message numbers remain unchanged.

MSG-CLASS = <name 3..3>
Specifies the new three-letter message class.

TO-MSG-ID = <alphanum-name 4..7 with-wild>
The new message code is specified either in full or as a partially qualified name containing wildcards.
The partial name determines the first part of the new message code; the remaining characters, symbolized by *, are transferred unchanged from the original message code.

Example

Old message code: MSG-ID = ABC1234;
TO-MSG-ID = TST0* changes the first four characters of the new message code to TST0 but retains the remaining three characters from the old message code. Result: TST0234.

TO-FILE = *CURRENT / <filename 1..54>(...)
Specifies the message file to which the message components are to be copied.

TO-FILE = *CURRENT The target file is the last message file opened with the //OPEN-MSG-FILE statement. As a target file it must be opened in UPDATE mode.

TO-FILE = <filename 1..54>
Explicit specification of the message file into which the message components are copied. If a target file does not exist, it is created and the file type (customer or standard), product name and product version are defined as for the source file.

OVERWRITE = *STD / *YES / *NO
Specifies whether the message components of the source file may overwrite an existing area of the target file.
The default value *STD corresponds to the value last specified in the OVERWRITE operand of the //MODIFY-OPTION statement.

Example

//COPY MSG-ID=TST000,INFORMATION=MESSAGE(LANGUAGE=E),-
  FROM-FILE=SYSMES.TSTFILE,TO-MSG-ID=*CLASS(TTO)