COPY command (STREAM or DATASET): Difference between revisions

From m204wiki
Jump to navigation Jump to search
 
(9 intermediate revisions by the same user not shown)
Line 45: Line 45:
<td>Specifies the use of data set formatting to improve the performance of the copy process. This option detects the proper end-of-file after an abnormal termination in the creation of the input stream.
<td>Specifies the use of data set formatting to improve the performance of the copy process. This option detects the proper end-of-file after an abnormal termination in the creation of the input stream.
<ul>  
<ul>  
<li>Specify the <var>CHECKPOINT</var> option if the stream being copied contains checkpoint records.</li>  
<li>Specify the <var>CHECKPOINT</var> option if the stream being copied contains [[Checkpoints:_Storing_before-images_of_changed_pages|checkpoint]] records.</li>  
<li>Specify the <var>JOURNAL</var> option if the stream being copied contains journal records. </li>
<li>Specify the <var>JOURNAL</var> option if the stream being copied contains [[Tracking_system_activity_(CCAJRNL,_CCAAUDIT,_CCAJLOG)#Using_Model_204_journal_files|journal records]]. </li>
</ul>
</ul>
<p>
<p>
If the option is omitted, no data set formatting of the input is performed.</p>
If the option is omitted, no data set formatting of the input is performed.</p>
<p>
<p>
A <var>GDG</var> stream, if <var>CHKPOINT</var> or <var>CCAJRNL</var>, can also be used as input to the <var>COPY STREAM</var> command. The following <var>DEFINE</var> commands and <var>COPY</var> command will copy a journal GDG stream. <code>JRNLIN</code> could have been a <var>CCAJRNL</var> or <var>CCARF</var> GDG stream in an Online or recovery run.</p>
A [[Configuring_checkpoint_and_journal_data_streams#Perpetual_journaling_for_z.2FOS|GDG stream]] , if <var>CHKPOINT</var> or <var>CCAJRNL</var>, can also be used as input to the <var>COPY STREAM</var> command. The following <var>DEFINE</var> commands and <var>COPY</var> command will copy a journal GDG stream. <code>JRNLIN</code> could have been a <var>CCAJRNL</var> or <var>CCARF</var> GDG stream in an Online or recovery run.</p>
<p class="code">//JRNLOUT  DD  DSN=complete.online.journal,DISP=SHR
<p class="code">//JRNLOUT  DD  DSN=complete.online.journal,DISP=SHR
DEFINE STREAM JRNLIN WITH SCOPE=SYSTEM GDG=JRN1 CONTROL=JCTL
DEFINE STREAM JRNLIN WITH SCOPE=SYSTEM GDG=JRN1 CONTROL=JCTL
Line 74: Line 74:
The <var>COPY</var> command allows the system manager to copy the contents of a stream to another stream. The input and output streams can be any of the following stream configurations:  
The <var>COPY</var> command allows the system manager to copy the contents of a stream to another stream. The input and output streams can be any of the following stream configurations:  
<ul>  
<ul>  
<li>Concatenated</li>
<li>[[Configuring_checkpoint_and_journal_data_streams#Concatenated_stream_configuration|Concatenated]]</li>
   
   
<li>Ring</li>
<li>[[Configuring_checkpoint_and_journal_data_streams#Ring_stream_configuration|Ring]]</li>
   
   
<li>Parallel</li>
<li>[[Configuring_checkpoint_and_journal_data_streams#Parallel_stream_configuration|Parallel]]</li>
</ul>
</ul>
<p>
<p>
Line 87: Line 87:
<li>Were interrupted by system failures </li>
<li>Were interrupted by system failures </li>
   
   
<li>Had the <code>CLOSE=NOAUTO</code> parameter setting specified in the <var>DEFINE STREAM</var> command </li>
<li>Had the <code>CLOSE=NOAUTO</code> parameter setting specified in the <var>[[DEFINE_STREAM_command|DEFINE STREAM]]</var> command </li>
</ul>
</ul>
<p>
<p>
In these cases, instead of copying from the beginning of the offloaded concatenated stream, you can start the copying from the oldest ring stream member with records not offloaded. For a discussion of this option, see the <var>[[RESTART command|RESTART]]</var> command. </p>
In these cases, instead of copying from the beginning of the offloaded concatenated stream, you can start the copying from the oldest ring stream member with records not offloaded. For a discussion of this option, see the <var>[[RESTART command|RESTART]]</var> command. </p>
<p>
<p>
Completion of offload processes is necessary if the stream is going to be used as input to the MERGEJ utility. The definition of the input stream must be identical to the definition used when the stream was originally created.</p>
Completion of offload processes is necessary if the stream is going to be used as input to the [[Media_recovery#MERGEJ_utility|MERGEJ]] utility. The definition of the input stream must be identical to the definition used when the stream was originally created.</p>
<p>
<p>
The copying process ends when an I/O error occurs on either the input or output stream, or when an end-of-data condition occurs on the input stream.</p>
The copying process ends when an I/O error occurs on either the input or output stream, or when an end-of-data condition occurs on the input stream.</p>
Line 100: Line 100:
====Interrupting a COPY STREAM command====
====Interrupting a COPY STREAM command====
<p>
<p>
The <var>COPY STREAM</var> command recognizes a bump or an urgent message and terminates processing. The following messages are issued: </p>
The <var>COPY STREAM</var> command recognizes a <var>[[BUMP_command|bump]]</var> or an urgent message and terminates processing. The following messages are issued: </p>
<p class="code">M204.0303:.USER INTERRUPTED, PROCESS TERMINATED
<p class="code">M204.0303:.USER INTERRUPTED, PROCESS TERMINATED
M204.1859:Txxxx BLOCKS HAVE BEEN COPIED TO OUTPUT STREAM/DATASET
M204.1859:Txxxx BLOCKS HAVE BEEN COPIED TO OUTPUT STREAM/DATASET
Line 107: Line 107:
<li>A bump causes a user restart with all messages written to the audit trail. </li>
<li>A bump causes a user restart with all messages written to the audit trail. </li>
   
   
<li>A message generated by either the <var>BROADCAST URGENT</var> or <var>WARN</var> commands is also issued to the user following the M204.0303 and M204.1859 messages. <var>BROADCAST URGENT</var> or <var>WARN</var> processing does not restart the user.</li>
<li>A message generated by either the <var>[[BROADCAST_command|BROADCAST URGENT]]</var> or <var>WARN</var> commands is also issued to the user following the M204.0303 and M204.1859 messages. <var>BROADCAST URGENT</var> or <var>WARN</var> processing does not restart the user.</li>
</ul>
</ul>


[[Category: System administrator commands]]
[[Category: System administrator commands]]
[[Category:Commands]]
[[Category:Commands]]

Latest revision as of 14:11, 11 February 2019

Summary

Privileges
System administrator
Function
Copies the contents of a stream or dataset to another stream or dataset.

Syntax

COPY [STREAM | DATASET] streamnameI TO [STREAM | DATASET] streamnameO [RESTART] [CHECKPOINT | JOURNAL] [COUNT=nnn]

Where:

streamnameI Specifies the name of the input stream to be copied from.
  • If the keyword STREAM is specified and the entity streamnameI is not defined as a STREAM, the COPY command fails.
  • If the keyword DATASET is specified and the entity streamnameI is not defined as a sequential data set, the COPY command fails.
  • If the keywords STREAM and DATASET are both omitted, the COPY command attempts to locate a STREAM entity for streamnameI, and, failing to do so, then attempts to locate a data set entity for the output stream.
streamnameO Specifies the name of the output stream to be copied to.
  • If the keyword STREAM is specified, and the entity named streamnameO is not defined as a STREAM, the COPY command fails.
  • If the keyword DATASET is specified, and the entity named streamnameO is not defined as a sequential data set, the COPY command fails.
  • If the keywords STREAM and DATASET are both omitted, the COPY command attempts to locate a STREAM entity for streamnameO, and, failing to do so, then attempts to locate a data set entity for the output stream.
RESTART Applies only to ring streams with an offload stream that is concatenated. RESTART specifies that copying start from the ring member that was offloading at the time of the system crash. Without RESTART (or if the offload stream was not originally defined as a concatenated stream), COPY copies the entire concatenated stream from its beginning and then adds any information not previously offloaded from the ring stream.

Note: Do not use RESTART if the system crash occurs when offloading is active. In this situation, RESTART is likely to duplicate some of your records.

  • If offloading was active at the time of the system crash, RESTART starts the copying process from a point prior to the crash: from the beginning of the ring member that was offloading at the time of the crash. Records from that ring member that were successfully offloaded to the concatenated stream before the crash are also copied to your output stream (streamnameO).
  • If the offload process was idle at the time of the system crash or when the ring stream was closed, the RESTART copying process begins from the idle point and not from an earlier point. No ring stream records are duplicated. Records offloaded before the crash or ring closing are in the concatenated stream; any remaining records are copied to streamnameO.
CHECKPOINT or JOURNAL Specifies the use of data set formatting to improve the performance of the copy process. This option detects the proper end-of-file after an abnormal termination in the creation of the input stream.
  • Specify the CHECKPOINT option if the stream being copied contains checkpoint records.
  • Specify the JOURNAL option if the stream being copied contains journal records.

If the option is omitted, no data set formatting of the input is performed.

A GDG stream , if CHKPOINT or CCAJRNL, can also be used as input to the COPY STREAM command. The following DEFINE commands and COPY command will copy a journal GDG stream. JRNLIN could have been a CCAJRNL or CCARF GDG stream in an Online or recovery run.

//JRNLOUT DD DSN=complete.online.journal,DISP=SHR DEFINE STREAM JRNLIN WITH SCOPE=SYSTEM GDG=JRN1 CONTROL=JCTL DEFINE DATASET JRN1 WITH SCOPE=SYSTEM OLD SEQUENTIAL - DSN=your.CCAJRNL DEFINE DATASET JCTL WITH SCOPE=SYSTEM OLD SEQUENTIAL - DSN=your.CCAJRNL.CTL.M204 COPY STREAM JRNLIN TO JRNLOUT JOURNAL

COUNT Specifies the maximum number of blocks to be copied from the input stream or data set to the output stream or data set. If this option is omitted, all of the blocks in the input stream or data set are copied.

Example

COPY DATASET MEMBERA TO DATASET MEMBERB CHECKPOINT COUNT=50 COPY STREAM AAA TO STREAM BBB CHECKPOINT

Usage notes

The COPY command allows the system manager to copy the contents of a stream to another stream. The input and output streams can be any of the following stream configurations:

You can specify whether the stream being copied is a checkpoint stream or a journal stream. With either of these stream types, you can validate the input records by using an appropriate routine to detect logical I/O errors. Run this process as a batch task.

If the stream was originally defined as a ring with an offload stream that was concatenated, COPY is useful for completing offload processes that either:

  • Were interrupted by system failures
  • Had the CLOSE=NOAUTO parameter setting specified in the DEFINE STREAM command

In these cases, instead of copying from the beginning of the offloaded concatenated stream, you can start the copying from the oldest ring stream member with records not offloaded. For a discussion of this option, see the RESTART command.

Completion of offload processes is necessary if the stream is going to be used as input to the MERGEJ utility. The definition of the input stream must be identical to the definition used when the stream was originally created.

The copying process ends when an I/O error occurs on either the input or output stream, or when an end-of-data condition occurs on the input stream.

For more information on sequential I/O processing, refer to Sequential I/O processing|.

Interrupting a COPY STREAM command

The COPY STREAM command recognizes a bump or an urgent message and terminates processing. The following messages are issued:

M204.0303:.USER INTERRUPTED, PROCESS TERMINATED M204.1859:Txxxx BLOCKS HAVE BEEN COPIED TO OUTPUT STREAM/DATASET

  • A bump causes a user restart with all messages written to the audit trail.
  • A message generated by either the BROADCAST URGENT or WARN commands is also issued to the user following the M204.0303 and M204.1859 messages. BROADCAST URGENT or WARN processing does not restart the user.