The SET statement sets values of indexes associated with table elements. It can also change the value of a conditional variable, change the status of an external switch, and store the address of a COBOL identifier reference at run time.
1 – 1format TO
The SET statement sets values of indexes associated with table elements. It can also change the value of a conditional variable, change the status of an external switch, and store the address of a COBOL identifier reference at run time. Format 1 - SET { rsult } ... TO val
1.1 – rsult
is an index-name, the identifier of an index data item, or an elementary numeric data item described as an integer.
1.2 – val
is a positive integer, which may be signed. It can also be an index-name (or the identifier of an index data item) or an elementary numeric data item described as an integer.
2 – 2format UP DOWN
The SET statement sets values of indexes associated with table elements. It can also change the value of a conditional variable, change the status of an external switch, and store the address of a COBOL identifier reference at run time. Format 2 - SET { indx } ... { UP BY } increm { DOWN BY }
2.1 – indx
is an index-name.
2.2 – increm
is an integer, which may be signed. It can also be the identifier of an elementary numeric data item described as an integer.
3 – 3format_cond-name
The SET statement sets values of indexes associated with table elements. It can also change the value of a conditional variable, change the status of an external switch, and store the address of a COBOL identifier reference at run time. Format 3 - SET { cond-name } ... TO TRUE
3.1 – cond-name
is a condition-name that must be associated with a conditional variable.
4 – 4format_switch-name
The SET statement sets values of indexes associated with table elements. It can also change the value of a conditional variable, change the status of an external switch, and store the address of a COBOL identifier reference at run time. Format 4 - SET { { switch-name } ... TO { ON } } ... { { OFF } }
4.1 – switch-name
is the name of an external switch defined in the SPECIAL-NAMES paragraph.
5 – 5format REFERENCE
The SET statement sets values of indexes associated with table elements. It can also change the value of a conditional variable, change the status of an external switch, and store the address of a COBOL identifier reference at run time. Format 5 - SET { pointer-id } ... TO REFERENCE OF identifier
5.1 – pointer-id
is a data-name whose data description entry must contain the USAGE IS POINTER or POINTER-64 clause.
5.2 – identifier
is a data item in the File, Working-Storage, Linkage Section, or Sub-Schema Section.
6 – 6format SUCCESS FAILURE
The SET statement sets values of indexes associated with table elements. It can also change the value of a conditional variable, change the status of an external switch, and store the address of a COBOL identifier reference at run time. Format 6 - SET status-code-id TO { SUCCESS } { FAILURE }
6.1 – status-code-id
is a word or longword integer data item represented by PIC S9(1) to S9(9) COMP.