Visual COBOL/Procobol compiler options/errors

I am trying to compile programs using the Windows Visual Cobol command line using the Oracle pre-compiler and getting the following errors;

 cobol srsw340.cob brief noanim ibmcomp nolist preprocess(cobsql) mode=ansi include=V:\hpconv\copy end-c comp5=yes endp;

Micro Focus COBOL
Version 6.0 (C) Copyright 1984-2021 Micro Focus or one of its affiliates.

* Cobsql Integrated Preprocessor
* CSQL-I-006: Rejected mode=ansi
* CSQL-I-006: Rejected include=V:\hpconv\copy
* CSQL-I-003: COBSQLTYPE is incorrect defaulting to Oracle
* CSQL-I-018: Invoking Oracle Precompiler/Translator
Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.

System default option values taken from: L:\products\oracle\WINDOWS.X64_193000_db_home\precomp\admin\pcbcfg.cfg

Error at line 138, column 11 in file V:\hpconv\copy\srsw340.cob
PCB-S-00106, Unable to open INCLUDE file "INDV"
Error at line 141, column 11 in file V:\hpconv\copy\srsw340.cob


My script looks like this (compile.bat)

set COPYEXT=.cob
set COBCPY=%1
cobol %2 brief noconfirm noverbose noanim ibmcomp nolist preprocess(cobsql) mode=ansi include=%1 end-c comp5=yes endp;


Note that;

1) It cannot find the SQL "INCLUDE" files (Which have an extension of .COB)

2) It appears to be rejecting the command line options

3) The compiler pauses with a "File SUTL9001 not found -  Press [S]top/[R]etry/[C]ontinue/[A]lter-path" quesion. How do i supress that?


Any help is greatly appreciated.

  • Verified Answer


    The mode=ansi and include=... values are not valid options for the COBSQL preprocessor. If you intended to pass those to ProCobol they should be after the end-c and before the endp.

    COPYEXT is a compiler directive not an environment variable so if you want to set that you should add COPYEXT(cob), without the '.', to your command line to cobol.exe eg after the nolist directive.

    Adding the NOQUERY directive will suppress the prompt for the missing copybook.

  • Thank you for your very informative reply. I have managed to progress a long way thanks to your help. I do appreciate it.

    One other question;

    Do you know how to specify the extension that oracle will use for include files?

    Thanks again

  • I'm sorry but I'm not familiar with using ProCobol so can't give you any additional information except to say that if you look at the Oracle ProCobol documentation on using INCLUDE files it says :

    If your system uses file extensions but you do not specify one, Pro*COBOL assumes the default extension for source files (usually COB). For more information, see your Oracle system-specific documentation.

    Hopefully somebody who knows about using ProCobol will be able to help you.

  • Thanks for your input. It has been very helpful and i do appreciate it.