Source conversion utility (scu)
The source conversion utility, scu
, is a stand-alone Linux® program
that assists in the conversion of COBOL source programs from non-IBM® or free-format source formats to a format that can be compiled by COBOL for Linux.
Scu
performs the following
transformations: - Converts white space characters to true spaces, including tab expansion, with optional controls
- Normalizes line-end characters
- Repositions items to start in the proper areas, such as the indicator area, Area A, or Area B, as required
- Ensures special alignment for CBL (PROCESS) statements
- Optionally blanks sequence numbers in columns 1 through 6, and removes serial numbers in columns 73 through 80
- Converts anomalous fixed-source-format input by default, and optionally converts free-format input
It also makes the following syntax and semantic
fixes:
- Adds missing spaces around quoted literals
- Adjusts the OCCURS clause to level 02 if it is at level 01
- Converts non-floating point literals to floating constant notations
- Fixes extra and misplaced periods
- Converts SET statements to MOVE when required by data types
- Converts "<>" to "NOT ="
- Replaces VALUES with VALUE
- Moves level 01 to Area A
- Replaces RECORD SEQUENTIAL with LINE SEQUENTIAL
Restrictions:
Scu
converts SET statements to MOVE only for the following data types:COMP
,COMP-4
, orBINARY
COMP-3
orPACKED-DECIMAL
COMP-5
DISPLAY
NATIONAL
(non-literal)
Scu
might incorrectly convert the SET statement to MOVE if the statement spans two or more lines.Scu
replaces VALUES with VALUE only when VALUES is followed by a literal on the same line.Scu
converts non-floating point literals to floating constant notations only when the literals and VALUE (or VALUES) are on the same line.Scu
ignores the REPLACE statement and the REPLACING phrase of the COPY statement.
Tips:
- For more information about Area A and Area B, see Reference format.
- Usually
scu
does initial transformation changes, and then fixes syntax and semantic errors (the -N option and copybooks are exceptions). However, ifscu
detects severe problems during transformation, such as non-COBOL standard special line,scu
will generate error messages and skip the syntax and semantic phase. The -N option and copybook exceptions:- When -N is specified,
scu
does only the initial transformation changes. - Syntax and semantic errors in copybooks are fixed when these errors
are fixed for the main source file with the -G option
specified. For more information about processing copybooks with
scu
, see Scu and copybooks.
- When -N is specified,
The
output file contains compatible COBOL code that includes all fixes
that scu
can provide. If you do not specify the -o option
for an output file name, the default output file is filename.scu.cbl
,
where filename
is the original
file name without the suffix. For example, the output file name for
the source abc.def.cob
is abc.def.scu.cbl
.
scu
issues return codes that indicate
a success or failure of program conversion. See the return codes and
corresponding explanations in the following table:
Return code | Explanation |
---|---|
0 | To indicate that scu runs successfully. |
1 - 4 | Reserved for future use to indicate success. |
5 | To indicate a general failure. |
6 | To indicate a failure to open a copy file. |
Attention:
Scu
converts source programs to a format that can be compiled with COBOL for Linux, but scu
might not identify or fix all
incompatibilities that exist in the code. IBM does not
guarantee that the changes made by scu
are error-free, or that the changes compile
and run as you expect. You must verify the results that are produced by scu
and
make sure that the changes meet your expectations. You might also need to further modify the code
that scu
attempted to correct.