Re: Batch compiling Fujitsu COBOL



Pete Dashwood wrote:
I may need to compile a bunch of COBOL programs written in Fujitsu
NetCOBOL.
(They are modules of source code produced by a generator I am
building.)
I've read Chapter 3 of the Users' Guide and the process is fairly
straight forward, however, I need to wrap this so an end User can do
it. I therefore need to provide a script or Windows Console that will
let a series of file names be specified (I think a textfile with a
list of file names would be cool), with options and outputs etc.

Before I go and write this, I was wondering of anyone has such a tool
they'd be prepared to share?

Alternatively, if I produce it, would anybody like a copy :-)?


I offered something similar some time back:

===== begin quote
So, I gussied it up:

(COMPILE.BAT)


@ECHO OFF
C:
CD \C-SOURCE
IF EXIST == RESULT.TXT DEL RESULT.TXT
IF EXIST == *.BLG DEL *.BLG
ECHO BEGIN COMPILATION BATCH > RESULT.TXT
FOR %%A IN (*.PPJ) DO call compile2.bat %%A
TYPE RESULT.TXT


(COMPILE2.BAT)


@ECHO OFF
ECHO Compile %1
echo === BEGIN %1 >> RESULT.TXT
POWERCOB /REBUILD %1
IF ERRORLEVEL 1 GOTO FAIL
GOTO OK


:FAIL
ECHO . >> RESULT.TXT
ECHO !!! E R R O R I N %1 !!! >> RESULT.TXT
ECHO . >> RESULT.TXT


:OK
TYPE *.BLG >> RESULT.TXT
DEL *.BLG /Q
echo === END %1 >> result.txt
ECHO =============================== >> RESULT.TXT
ECHO =============================== >> RESULT.TXT
ECHO . >> RESULT.TXT
ECHO . >> RESULT.TXT


====== end quote

To which you replied:

=== begin quote

Cool! (in a 1980s kind of way...:-))


These days it should be a WSH script, but, Hey, if it works...and it
obviously does.

=== end quote

The above might be a starting point.... (in a 1980's kind of way)


.



Relevant Pages