How do I compile fixed (ANSI) format source that COPYs terminal format source or vice versa?
Question ID : 65
Created on 2009-09-02 at 12:00 PM
Author : Veryant Support [firstname.lastname@example.org]
Online URL : http://support.veryant.com/support/phpkb/question.php?ID=65
isCOBOL has compile options for ANSI (-sa), FREE (-sf) or TERMINAL (-st) format. What if I have a source file in one format that copies in a file that is in another format? How do I compile the program?
For example what if I have a source file in fixed format where columns 1-6 are the sequence number, column 7 is the indicator area, columns 8-11 are area A, 12-72 are area B, etc, and the source file copies in a copy file that is in terminal format (or free format) such that columns 1-7 are part of the normal source line and there is no distinction between area A and B, etc, then how do I compile this with isCOBOL. What compile option do I use? or what is the solution?
With versions prior to 2009, the only way to compile in this type of situation is to add the appropriate SOURCE FORMAT compiler directive to the top of each file from the following list:
>>SOURCE FORMAT FIXEDIf you need to change a lot of copy files, you can request the ISCOPIES utility from Veryant.
>>SOURCE FORMAT FREE
>>SOURCE FORMAT TERMINAL
With isCOBOL Compiler versions 2009 and later, you can compile with
-smat to specify that you have mixed ANSI and TERMINAL source formats.
The rules that the compiler uses to determine the source format are as follows:
With isCOBOL 2008 SP1 and earlier, the compiler looks at the character in the 7th column of the first not empty line. If this character is a valid indicator (*,$,/) or a blank, then the source file is assumed to be in FIXED (aka ANSI) format, otherwise it is assumed to be in FREE format. The format is assumed to be the same for the source file and all copy files included in it.
With isCOBOL 2009 and later, a new rule has been added. If the first character of the first not empty line is a valid indicator, not including the case of "*>", then the source file is assumed to be in TERMINAL format.
As result, a valid comment on the first line establishes the format in a portable way.
-smat option has two effects:
1) If the file is not in FIXED (aka ANSI) format then the file is in TERMINAL format
2) The analysis is repeated again for each copy file
Back to Original Question