Function
The SOURCE clause identifies the data item whose contents the Report Writer (by an implicit MOVE statement) will move to the printable item whose description includes the SOURCE clause, when this item is to be printed.
Format
SOURCE IS identifier
Syntax rule
Any identifier defined in any section of the Data Division may be specified in a SOURCE clause. In the case of the REPORT SECTION, however, a SOURCE clause may use only the PAGE-COUNTER special register, the LINE-COUNTER special register, or a sum counter if it is associated with the report in whose description the SOURCE clause appears.
General rules
The description of an elementary item containing a SOURCE clause must also contain a COLUMN clause, that is, the field must be printable.
The SOURCE clause in conjunction with the COLUMN clause generates an implicit MOVE statement. For this MOVE statement, the source (or sending) field is defined by the identifier from the SOURCE clause. The receiving field is the printable item whose description includes the SOURCE clause. The picture strings of the PICTURE clauses of the two fields must adhere to the rules for sending items in the MOVE statement (see section "MOVE statement").
As the SOURCE clause can never change the value of the data item it specifies, it may also refer to a control data item. Generally, the system prints the value of the sending field as it is when the MOVE statement is executed (creation of the associated report group). If the previous values of the control break data items are in control footings, Function 1 of the CBL-CTR special register (see section "CBL-CTR special register") should be used.
Example 10-7
FILE SECTION. ... 02 DEPT PIC XXX. ... REPORT SECTION. ... 02 COLUMN 19 PIC XXX SOURCE DEPT. ...
The SOURCE clause has the effect that the value in the data item DEPT is moved to the printable item concerned when the associated report group is printed.