Top
NetCOBOL V11.0 Syntax Samples
FUJITSU Software

1.8 Free Format

Free format enables coding to be done without having to worry about such things as line numbers, indicator areas, area A, or area B.

The compiler option SRF (FREE) must be specified to compile source code using free format.

This sample applies only to Win32, Winx64, Solaris, Linux, LinuxIPF, Linux64 and .NET.

000010 @OPTIONS MAIN,SRF(FREE)
*>---------------------------------------------------------------------------
*> This is a coding example of free format.
*>
*> Specify the compiler option SRF(FREE) to compile source using free format.
*>---------------------------------------------------------------------------
IDENTIFICATION   DIVISION.
PROGRAM-ID.      SAMPLE.
DATA             DIVISION.
WORKING-STORAGE  SECTION.
77 MSG           PIC X(60).
PROCEDURE        DIVISION.
*>---------------------------------------------------------------------------
*> The comment ("*>") is used for comments.
*> Comments can be written from any column location.
*>---------------------------------------------------------------------------
DISPLAY " ".    *> The A or B areas need not be considered.
*>---------------------------------------------------------------------------
*> Blank lines can also be written.
*>---------------------------------------------------------------------------
*>---------------------------------------------------------------------------
*> Nonnumeric literals can also be continued.
*> -  Unlike variable-length format, the line is closed once using quote 
*>    marks.
*> -  A "-" is coded immediately after the closing quote mark.
*> -  Blank characters to be coded after a "-".  
*> -  The continued line starts from the next quote mark.
*>---------------------------------------------------------------------------
  MOVE "Hello, I'm "- 
       "a NetCOBOL Program. Ha"- 
       "ve a good time!!"    TO MSG.
  DISPLAY MSG.
END PROGRAM SAMPLE.