Skip to main content

Problem:
Unable to compile programs with BASIS mechanism and the error message is “COBCH0143S Unknown IDENTIFICATION DIVISION paragraph”.

The program contains  the BASIS statement (control file):
000100 BASIS DBASIS
000200 INSERT 000099                   
000300 REPLACE                         
000400    ==DBASIS==     BY ==MAINPRG==
000500    ==:FNAME:==    BY ==PRNTF==
000600    .    

Code Snippet of DBASIS.cbl (subject file):
000099*
000100 IDENTIFICATION DIVISION.
000101 PROGRAM-ID. DBASIS.
000102
000103 ENVIRONMENT DIVISION.
000104 INPUT-OUTPUT SECTION.
000105 FILE-CONTROL.
000106      SELECT :FNAME:-FILE
000107        ASSIGN TO PRNTFILE.
000108
…
…

Resolution:

In order to compile programs using BASIS,  the following compiler directive  must be included: p(basis)


BASIS is similar to the COPY  with REPLACING statement and follows the same rules.  BASIS can  INSERT, DELETE and REPLACE statements in the subject file during compilation.

There are also rules on the use of the BASIS syntax and are defined in this link: http://documentation.microfocus.com/help/topic/com.microfocus.eclipse.infocenter.enterprisedeveloper.eclipsewin/HRLHLHCOMP0C.html
Additional Notes:
1.    In unix, the subject file must be located in the same directory as the control file. In Eclipse, it can be located with the directories indicated in COBCPY environment variable.
2.    In unix, the extension of the subject file is “.cbl” , in small letters.  Example is DBASIS.cbl
Attached are the sample programs to illustrate the BASIS mechanism.

0842.BASIS.zip


#MFDS
#EnterpriseDeveloper