Previous Topic Next topic Print topic


PCOMP

Enables you to specify a user program as a precompiler for COBOL files.

Syntax:

>>-.---.--PCOMP--"userprog"------><
   +-/-+

Parameters:

userprog The user program to be used as a precompiler..

Properties:

Default: None

Comments:

The user program should return an external filename.

If userprog is not found, the compilation fails.

The user program can use CBL_EXIT_PROC to perform some post-build processing.

Example:

working-storage section.
       01.
           05 install-flag       pic x comp-x.
           05 install-params.
               10 exit-proc-ptr  usage procedure-pointer.
               10                pic x.

       01 p-exit-block.
           03 p-block-size       pic x(4) comp-5 value 16.
           03 p-return-code      pic x(4) comp-5.
           03 p-rts-error        pic x(4) comp-5.
           03 p-exit-flags       pic x(4) comp-5.

       linkage section.
       01 source-file            pic x(256).

       procedure division using source-file.
           display source-file
      * On exit the file specified in source-file is the one
      * the compiler will actually compile
           move "EMPLOY.BMS" to source-file

           set exit-proc-ptr to entry "exitproc"
           move 0 to install-flag
           call "CBL_EXIT_PROC" using install-flag
                                       install-params
           end-call

      * Zero means continue, non-zero abort
    move 0 to return-code 
           exit program
           .

       exitproc section.
       entry "exitproc".
           display "in exit proc"

           call "CBL_GET_EXIT_INFO" using     p-exit-block

           exit program
           .
Previous Topic Next topic Print topic