SRCFORMAT

Use SRCFORMAT to indicate whether your COBOL source conforms to 72-column fixed source format or to 252-column extended source format.

SRCFORMAT option syntax

Read syntax diagramSkip visual syntax diagramSRCFORMAT(COMPATEXTEND)

Default is: SRCFORMAT(COMPAT)

Abbreviations are: SF(C|E)

SRCFORMAT(COMPAT) indicates that each source line of the primary compilation input and of any included COPY text ends at column 72. If a source line is shorter than 72 bytes, space characters are logically added to the source line up to the maximum of 72 bytes. If a source line is longer than 72 bytes, only the first 72 bytes are used as program source. (Bytes 73 through 80, if provided, are assumed to contain serial numbers; they are printed in the compiler listing but otherwise ignored.)

SRCFORMAT(EXTEND) indicates that each source line of the primary compilation input and of any included COPY text ends at column 252. If a source line is shorter than 252 bytes, space characters are logically added to the source line up to the maximum of 252 bytes. If a source line is longer than 252 bytes, only the first 252 bytes are used as program source; the rest are ignored. (In extended source format, there is no provision for serial numbers.)

In either format, columns 1 through 6 are interpreted as sequence numbers.

Option specification: You cannot specify the SRCFORMAT option in a PROCESS (or CBL) statement. You can specify it only in one of the following ways:

  • As an option in the cob2 command
  • In the COBOPT environment variable
  • In the compopts attribute of the configuration (.cfg) file

A source conversion utility, scu, is available to help convert non-IBM® or free-format COBOL source so that it can be compiled by COBOL for Linux®. To see a summary of the scu functions, type the command scu -h. For further details, see the man page for scu, or see the appropriate related reference.

Restriction: Extended source format is not compatible with the stand-alone Db2® precompiler or the separate CICS® translator.

Related references  
Stanzas in the configuration file  
cob2 options
  
Reference format (COBOL for Linux on x86 Language Reference)  
Source conversion utility (scu) (COBOL for Linux on x86 Language Reference)