Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>According to the AcuCOBOL docs (which I use):</p> <blockquote> <p>When the CORRESPONDING phrase is used, selected elementary items in source-group are moved to corresponding items in dest-group. This is treated as a series of Format 1 MOVE statements, one for each corresponding pair of data items.</p> </blockquote> <p>A Format 1 move looks like the following:</p> <blockquote> <p>MOVE source-item TO {dest-item}</p> </blockquote> <p>Given the following file and working storage definition</p> <pre><code>DATA DIVISION. FILE SECTION. FD PRODUCT-INFO-FILE. 01 PRODUCT-INFO-RECORD. 03 PI-HOLD-PROD PIC x(12). 03 PI-HOLD-DESC PIC x(30). 03 PI-HOLD-DISC PIC 9(01). 03 PI-HOLD-TOTAL PIC 9(08)V99. WORKING-STORAGE SECTION. 01 HOLD-FIELDS-DEST. 03 WS-HOLD-PROD PIC x(12). 03 WS-HOLD-DESC PIC x(30). 03 WS-HOLD-DISC PIC 9(01). 03 WS-HOLD-TOTAL PIC 9(08)V99. </code></pre> <p>Doing this:</p> <pre><code>MOVE CORRESPONDING PRODUCT-INFO-RECORD TO HOLD-FIELDS-DEST. </code></pre> <p>would be the same as doing this:</p> <pre><code>MOVE PI-HOLD-PROD TO WS-HOLD-PROD. MOVE PI-HOLD-DESC TO WS-HOLD-DESC. MOVE PI-HOLD-DISC TO WS-HOLD-DISC. MOVE PI-HOLD-TOTAL TO WS-HOLD-TOTAL. </code></pre> <p>That saved 3 lines of code. A lot of files are wider than that.</p> <p>EDIT: This is also from the same set of docs...</p> <blockquote> <p>The following table outlines the combinations of source-item and dest-item that are allowed by the MOVE statement. The numbers in the table are the "General Rules" numbers in this section where each combination is described:</p> </blockquote> <pre><code>Sending Category: Receiving Item Category: Alphabetic Alphanumeric/Alphanumeric Edited Numeric /Numeric Edited Alphabetic Yes (12) Yes (13) No (15) Alphanumeric Yes (12) Yes (13) Yes (14) Alphanumeric Edited Yes (12) Yes (13) No (15) Numeric Integer No (15) Yes (13) Yes (14) Numeric Non-integer No (15) No (15) Yes (14) Numeric Edited No (15) Yes (13) Yes (14) </code></pre> <blockquote> <p>'12. When dest-item is alphabetic, justification and space filling occur according to the standard alignment rules.</p> <p>'13. When dest-item is alphanumeric or alphanumeric edited, justification and space filling occur according to the standard alignment rules. If source-item is signed numeric, the operational sign is not moved. If the sign occupies a separate character position, that sign character is not moved, and the size of source-item is treated as being one less.</p> <p>'14. When dest-item is numeric or numeric edited, decimal point alignment and zero filling occur according to the standard alignment rules. If source-item is unsigned, it is treated as being positive. If dest-item is unsigned, the absolute value of source-item is moved. If dest-item is signed, its sign is set to the sign of source-item. If source-item is numeric edited, it is "de-edited" first such that dest-item receives the same numeric value.</p> <p>'15. The following moves are illegal: An alphabetic or alphanumeric edited data item may not be moved to a numeric or numeric edited data item. A numeric or numeric edited data item may not be moved to an alphabetic item. A non-integer numeric data item cannot be moved to an alphanumeric or alphanumeric edited data item.</p> </blockquote>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload