To copy a line or a block of lines to another place in the work file, use any of the following forms of the copy (C) line command:
|
Use: |
To: |
|---|---|
|
%C(space) |
Copy the indicated line to the destination marked by the %A or %B command. |
|
%Cn(space) |
Copy the specified number of lines to the destination marked by the %A or %B command. For example, %C5 copies the line on which the command is located and the four lines immediately following that line. |
|
%CB(space). . .%CE(space) |
Copy a block of lines to the destination marked by the %A or %B command. The two lines marked with %CB and %CE and all intervening lines are copied. The original lines are not deleted. Note: You can enter block commands (%CB and %CE), so that they span more than one page of the work file. |
|
%A(space) or %B(space) |
Determine where the selected lines are copied:
|
Scenario—Copying Lines
The following scenario illustrates how to copy lines on the online compiler screens. The following example shows the original work file as it appears on the online compiler screen.
IDD nn.n ONLINE PAGE 1 LINE 1 1/3 ADD RECORD IS KBR-DC-REC VERSION IS 3 PREPARED BY KBR. RECORD ELEMENT IS ADDRESS-0415-KBR USAGE IS DISPLAY. RECORD ELEMENT IS EMP-ID-0415-KBR PICTURE 9(5) USAGE IS DISPLAY. RECORD ELEMENT IS EMP-NAME-0415-KBR USAGE IS DISPLAY.
The copy (%c) line command copies the COBOL picture for EMP-ID-0415 KBR to the line after the line designated by the copy after (%a) command.
IDD nn.n ONLINE PAGE 1 LINE 1 1/3 ADD RECORD IS KBR-DC-REC VERSION IS 3 PREPARED BY KBR. RECORD ELEMENT IS ADDRESS-0415-KBR USAGE IS DISPLAY. RECORD ELEMENT IS EMP-ID-0415-KBR %c PICTURE 9(5) USAGE IS DISPLAY. RECORD ELEMENT IS %a EMP-NAME-0415-KBR USAGE IS DISPLAY.
The following online compiler screen displays the results of the copy procedure in the modified work file:
IDD nn.n ONLINE PAGE 1 LINE 1 1/3 ADD RECORD IS KBR-DC-REC VERSION IS 3 PREPARED BY KBR. RECORD ELEMENT IS ADDRESS-0415-KBR USAGE IS DISPLAY. RECORD ELEMENT IS EMP-ID-0415-KBR PICTURE 9(5) USAGE IS DISPLAY. RECORD ELEMENT IS EMP-NAME-0415-KBR PICTURE 9(5) USAGE IS DISPLAY.
|
Copyright © 2014 CA.
All rights reserved.
|
|