Skip to main content

Are Mixed Source Formats Possible

  • January 24, 2019
  • 2 replies
  • 0 views

Visual Studio 2013

Visual COBOL 2.2

Is it possible to have a managed project where the COBOL program has Variable source format (as defined in the project properties) but with the copy books referenced by the program having themselves a Fixed source format?  I would envision the inclusion of a $SET statement immediately preceding the COPY statement and then another $SET statement immediately following the COPY statement.  Does such a $SET statement exist?

Thanks,

Austin

2 replies

Chris Glazier
Forum|alt.badge.img+2

Visual Studio 2013

Visual COBOL 2.2

Is it possible to have a managed project where the COBOL program has Variable source format (as defined in the project properties) but with the copy books referenced by the program having themselves a Fixed source format?  I would envision the inclusion of a $SET statement immediately preceding the COPY statement and then another $SET statement immediately following the COPY statement.  Does such a $SET statement exist?

Thanks,

Austin

Hi Austin,


Yes, you can change the source format within a COBOL program by using the $SET SOURCEFORMAT directive.


$SET SOURCEFORMAT"VARIABLE"
ID DIVISION.
PROGRAM-ID. TESTPROG.
...


$SET SOURCEFORMAT"FIXED"

COPY "mycopy".


$SET SOURCEFORMAT"VARIABLE"

01 my-data pic x.
...

  • January 25, 2019

Visual Studio 2013

Visual COBOL 2.2

Is it possible to have a managed project where the COBOL program has Variable source format (as defined in the project properties) but with the copy books referenced by the program having themselves a Fixed source format?  I would envision the inclusion of a $SET statement immediately preceding the COPY statement and then another $SET statement immediately following the COPY statement.  Does such a $SET statement exist?

Thanks,

Austin

That works !!!
Thanks, Chris !!!