Source conversion utility (scu) options

Multiple options are available in the source conversion utility (scu) for source program conversion.

The scu command has the following syntax:

Read syntax diagramSkip visual syntax diagram scu-h-\?-V?-7-b-e-E-f-Goutput_directory_name-Iinput_directory_name-L-M-N-ooutput_filename-s-ttabstop-ttabwidth-vsource_filename

Option descriptions:

-7
If a line starts with a special character, the -7 option detects and moves the character to column 7 (the indicator area of fixed or extended format). The special character here can be an asterisk '*', slash '/', dollar sign '$', character 'D' followed by space and 'd' followed by space. The characters that follow the moved special character are handled depending on their positions:
  • If the following characters are in column 2 - 7, the entire line is moved to the right until the special character is in column 7.
  • If the following characters are in Area A or B, they remain where they are, unless there are characters in column 73 or beyond. When there are characters in column 73 or beyond, the characters might be moved left to the start of Area B.
Notes:
  • For a dollar sign '$', scu issues an error that states manual intervention is required for this line.
  • The special character '-' as the first character of a line is moved to column 7 only when you specify both the -f and -7 options or when the -f option is specified and '-' is in column 1.
  • For special characters that are not in column 7 or are not moved to column 7, scu handles these characters as regular (non-special) ones.
-b
Removes trailing blanks.
-e
Indicates whether an input file is in extended source format of a 252-character line. This option allows scu to distinguish the extended format from the default fixed format and covert the source code correctly.
-E
Tells scu that the output (the converted source) is not limited to the default 72 columns (the fixed format). scu can extend the lines to the maximum length of 252 columns if necessary.
-f
Identifies the input source as being in free format. By default the fixed (compatible) source format allows executable COBOL source code in Area A (column 8 - 11), and Area B (column 12 - 72), with indicators in column 7. Optionally, if you specify -e, Area B is extended to column 252 for the input file. The -f option causes scu to move COBOL source code from column 1 - 6 to the indicator column, Area A, or Area B depending on the content of the source code to be moved.
The -f option handles free-format source lines that start with special characters in one of the following ways:
  • If the special character is in column 1 (the indicator area of free format), the character is moved to column 7 (the indicator area of fixed format).
  • If the special character is in column 2-11, it is moved to column 12 (the start column of Area B).
Notes:
  • Special characters in a free-format source file can be '*', '/', '$', '-','D' followed by space and 'd' followed by space.
  • By default the -f option is not specified, and a special character at the start of a free-format line is moved to column 12 (start column of Area B) only when it is in column 8-11 (Area A). When the special character is in other columns, it remains where it is. A character that is not a special character in column 7 is blanked out.
  • When the -f option is used in combination with the -7 option, any special character in column 1-6 is moved to column 7. This usage is similar to the -7 option alone, but includes '-' as a special character.
-G<copybook output directory name>
Fixes COPY files and places them in the specified directory. For a COPY file that is qualified with a directory name, the directory name is kept as the subdirectory of the specified COPY file directory. If the -G option is not specified, only the main source file is fixed.
Note: Do not insert spaces between -G and <copybook output directory name>.
-h
Provides scu basic help with information about the available functions of scu. You can also specify -\? to display the same help information as -h does. For more detailed help, see the scu man page by running the command man scu.
-I<copybook input directory name>
Adds the specified path to the directories to be searched for copybooks if a library-name or SYSLIB is not specified.
Notes:
  • This option is the uppercase letter I, not the lowercase letter l.
  • Only a single path is allowed for each -I option. To add multiple paths, use multiple -I options.
  • Do not insert spaces between -I and <copybook input directory name>.
  • COPY files that are retrieved from an -I directory, fixed by scu and stored in the-G directory can then be picked up by specifying -I and the same -G directory. In this way, scu uses a fixed version of the copy file on subsequent runs against the same or different main source files.
-L
Indents level numbers other than 01 and 77 to Area B when the level numbers are in Area A.
-M
Issues a scu fix code (for example, SCU0001) at the end of each fixed line and provides a short description and summary at the bottom of the output file. When standard compatible COBOL is input and the option -M is specified, a scu fix code is added to the unused noncompilable columns (starting at column 82) to indicate that the line is changed. A summary is also provided to display fix information that is associated with each fix code. The fix codes and summary are provided for syntax and semantic changes, not for the initial transformation changes. For example, when you specify -f to convert a file of free format to fixed 80 column or extended format, the line changes are made but you do not receive a scu fix code.
Use the fix code numbering to identify the level of needed attention for the message:
Table 1. Scu message severity levels
Fix code range Severity Description
SCU0001 - SCU1999 Informational Scu expects that no further changes are needed for the fix.
SCU2000 - SCU3999 Warning Scu expects that further changes might be needed. For instance, the fix of changing OCCURS from level 01 to level 02 might require further changes that are related to the fix.
SCU8000 - SCU8999 Error Scu expects that further changes are required to complete the fix.
SCX0001 - SCX8999 Unfixed error The problem is identified but scu is unable to fix the problem. The SCXnnnn error code corresponds to the matching SCUnnnn fix code.
SCX9000 - SCX9999 Ignored error The problem is identified, but scu does not attempt to fix it.
Note: Scu might not identify or fix all incompatibilities that exist in the code.
The following list gives examples of scu fix codes and the corresponding fixed errors:
SCU0001 fix for IGYDS0001-W: Add missing space(s).
SCU0004 fix for IGYPS0019-W: Extra and misplaced periods in COBOL source. Scu removes the
extra periods.
SCU1002 fix for IGYGR1080-S: Non-floating point literal is assigned to floating point data
item. Scu converts it to floating point constant notation.
SCU1005 fix for IGYPS2024-S: SET used in place of MOVE. Scu converts SET stmt to MOVE stmt.
SCU1006 fix for IGYPS2094-S: "<>" converted to "NOT = ".
SCU1008 fix for IGYDS0017-E: "01" not in Area A. Scu moves 01 to Area A.
SCU3001 fix for IGYDS1063-E: OCCURS clause in level 01. Scu changes it to level 02 and adds 
a dummy 01. 
SCU8001 fix for IGYDS0093-S: RECORD SEQUENTIAL not supported. Scu replaces RECORD
SEQUENTIAL with LINE SEQUENTIAL.
SCX9001 specified for an 02 level data item following an 01 level OCCURS that has been changed
to an 02 level OCCURS with fix code SCU3001
-N
Enables scu to do only the initial transformation changes without syntax and semantic changes, and forces the output to be written to the standard output.
-o <output filename>
Specifies the output file name for the source file. The output file can be qualified with an existing directory. For example, the command scu -o/dirname1/abc.modified.cbl abc.cbl saves the output file abc.modified.cbl in the /dirname1 directory. By default the output file is saved in your current directory. If the -o option is not specified, the output file for the source file would be abc.scu.cbl.
-s
Removes the leading and trailing sequence numbers by blanking columns 1-6 and truncating the source line at column 73.
-t <tabwidth>
Passes to scu the tab width that is used in the source code to ensure that the converted data is in correct columns. Tab characters that are encountered before a tab position are replaced by spaces sufficient to move the ensuing character to the tab position. The default tab width is 8.
-t <tabstop>,...
Passes to scu the tab stops for conversion. Specify two or more tab stops separated by commas. Tab characters encountered past the last tab position are replaced by a single space character.
-v
Enables verbose output so that error and fix information is sent to STDERR during the source transformation, syntax and semantic checking, and fixing.
-V
Displays the version information of scu.

Copybooks and scu:

It is a good practice to have all copybooks go through transformation changes before scu attempts to fix syntax and semantic errors, because currently scu does not automatically perform transformation changes on copybooks. You can first run scu for your copybooks by specifying the -N option with any other transformation options, such as -7, -b, -e, -E, -f, -L, -s, and -t. Then, run scu for the main source files and specify -I with the copybook directory that contains the transformed copybooks for syntax and semantic error processing.