Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Batch compiling Fujitsu COBOL
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
), 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 :-)?

Pete

--
"I used to write COBOL...now I can do anything."



Report this thread to moderator Post Follow-up to this message
Old Post
Pete Dashwood
07-30-07 02:55 AM


Re: Batch compiling Fujitsu COBOL
On Jul 30, 2:02 pm, "Pete Dashwood"
<dashw...@removethis.enternet.co.nz> wrote:
> I may need to compile a bunch of COBOL programs written in Fujitsu NetCOBO
L.
>
> (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 therefor
e
> 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
> ), 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 :-)?
>
> Pete
>
> --
> "I used to write COBOL...now I can do anything."


'make' works for MS Windows version of Fujitsu 6. It should be OK with
7.  In fact the project generates a makefile and then runs this. You
should be able to pick this out and construct your own makefile. The
advantage is that it will work out dependencies and compile whatever
is needed.






Report this thread to moderator Post Follow-up to this message
Old Post
Richard
07-30-07 08:55 AM


Re: Batch compiling Fujitsu COBOL

"Richard" <riplin@Azonic.co.nz> wrote in message
news:1185771148.405673.243830@m37g2000prh.googlegroups.com...
> On Jul 30, 2:02 pm, "Pete Dashwood"
> <dashw...@removethis.enternet.co.nz> wrote: 
>
>
> 'make' works for MS Windows version of Fujitsu 6. It should be OK with
> 7.  In fact the project generates a makefile and then runs this. You
> should be able to pick this out and construct your own makefile. The
> advantage is that it will work out dependencies and compile whatever
> is needed.
>
>
That's a good idea. Thanks, Richard.

There won't be any dependencies between these modules, and my initial
thought was to simply compile and link them, producing a series of .EXEs

I never thought about using MAKE. It might be possible to combine each batch
of these programs into a single Library, and that would have a number of
advantages later in the process (Not to mention packaging).

I'll think about doing something with MAKE.

Cheers,

Pete.

--
"I used to write COBOL...now I can do anything."



Report this thread to moderator Post Follow-up to this message
Old Post
Pete Dashwood
07-30-07 08:55 AM


Re: Batch compiling Fujitsu COBOL
Pete

I use a dos batch file to compile my programs. After the batch is run
any program will an error will have a file filename.ERR, that contains
all the error messaages.


ECHO OFF
IF EXIST %1.ERR. (DEL %1.ERR)
IF EXIST %1.EXE. (DEL %1.EXE)
IF EXIST %1.LST. (DEL %1.LST)
IF EXIST %1.PDB. (DEL %1.PDB)
del %1.exe
SET COB_OPTIONS=cobol.cbi
CALL "COBOLC.EXE" %1.CBL /WC:SRF(FIX,FIX) /TARGET:EXE /MAIN:%1 /PRINT:
%1.ERR /REFERENCE:\TLL\FILE_SYSTEM.DLL /copypath:\TLL\LIB

IF EXIST %1.EXE. (DEL %1.ERR)


FYI
Try running cobolc /? in a dos prompt for more/other options you may
need for you system.
The file_system.dll is a vb.net application that handles all the sql
IO.


Good luck
Tom


Report this thread to moderator Post Follow-up to this message
Old Post
tleaders...gmail.com
07-30-07 11:55 PM


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 ), 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)



Report this thread to moderator Post Follow-up to this message
Old Post
HeyBub
07-30-07 11:55 PM


Re: Batch compiling Fujitsu COBOL
"tleaders...gmail.com" <tleaders@gmail.com> wrote in message
news:1185801886.552807.6300@x40g2000prg.googlegroups.com...
>
> Pete
>
> I use a dos batch file to compile my programs. After the batch is run
> any program will an error will have a file filename.ERR, that contains
> all the error messaages.
>
That's a nice touch.

>
> ECHO OFF
> IF EXIST %1.ERR. (DEL %1.ERR)
> IF EXIST %1.EXE. (DEL %1.EXE)
> IF EXIST %1.LST. (DEL %1.LST)
> IF EXIST %1.PDB. (DEL %1.PDB)
> del %1.exe
> SET COB_OPTIONS=cobol.cbi
> CALL "COBOLC.EXE" %1.CBL /WC:SRF(FIX,FIX) /TARGET:EXE /MAIN:%1 /PRINT:
> %1.ERR /REFERENCE:\TLL\FILE_SYSTEM.DLL /copypath:\TLL\LIB
>
> IF EXIST %1.EXE. (DEL %1.ERR)
>
>
> FYI
> Try running cobolc /? in a dos prompt for more/other options you may
> need for you system.

Chapter 3 of the Fujitsu User Guide fully documents all the compiler and
linker options available.

It took a few years, but Fujitsu finally got their documentation into shape
and what they have now is useful and clear.

> The file_system.dll is a vb.net application that handles all the sql
> IO.
>
>
> Good luck

Thanks! I'm hoping I won't need it... :-)
> Tom
>
Thanks for posting the batch file, Tom. It brought back some happy memories
:-)

I haven't written any DOS Batch files for many years now, but I agree it is
a simple and effective solution.

I'm still thinking about how to integerate whatever I decide on with the
rest of my solution and DOS does not fit too well.

I'll either wrap it as a DotNET desktop solution (in C#) or use Windows
Script Hosting (which is the modern replacement for Batch files).

Nevertheless, I appreciate you taking the time to post, and it was
interesting looking through the Batch file.

Thanks.

Pete.



Report this thread to moderator Post Follow-up to this message
Old Post
Pete Dashwood
07-30-07 11:55 PM


Re: Batch compiling Fujitsu COBOL

"HeyBub" <heybubNOSPAM@gmail.com> wrote in message
news:13arre07kgak87f@news.supernews.com...
> Pete Dashwood wrote: 
>
> 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)
>
>
Thanks Jerry. I stand chastised... :-)

It is pretty clear what I need to do, I was just trying to save myself the
time doing it :-)

I apologise unreservedly for being dismissive of your solution (although I
did appreciate the elegance of the Batch file). I really don't want to
deliver DOS Batch technology in 2007. The rest of the solution is
"state-of-the-art" so the mundane housekeeping needs to be also.

However, I really appreciate the fact that people have responded with
various solutions and if I was stuck for knowing where to start, I certainly
wouldn't be any more.

I think Richard's suggestion of using MAKE is a very good one and it is
something I had completely overlooked. As I'm sure you know, the Fujitsu
Project Manager generates MAKE files for a project and it is quite an
elegant solution.

Whatever I end up with, I will make available to the community here, in
appreciation of the posts received.

Pete.
--
"I used to write COBOL...now I can do anything."



Report this thread to moderator Post Follow-up to this message
Old Post
Pete Dashwood
07-30-07 11:55 PM


Re: Batch compiling Fujitsu COBOL
Pete Dashwood wrote:
> Thanks Jerry. I stand chastised... :-)
>
> It is pretty clear what I need to do, I was just trying to save
> myself the time doing it :-)
>
> I apologise unreservedly for being dismissive of your solution
> (although I did appreciate the elegance of the Batch file). I really
> don't want to deliver DOS Batch technology in 2007. The rest of the
> solution is "state-of-the-art" so the mundane housekeeping needs to
> be also.

No apology needed.

An engineer and a mathematician, who both know how to drink from a cup, are
confronted with a water fountain.

The engineer studies the problem for a moment, then bends over and has a
refreshing drink.

The mathematician studies the problem for a moment... and  fills his cup!

Engineers are taught to solve new problems directly; mathematicians are
taught to reduce a new problem to one that has already been solved.

You're an engineer; I'm the other kind. It's the result that counts.



Report this thread to moderator Post Follow-up to this message
Old Post
HeyBub
07-31-07 11:55 PM


Re: Batch compiling Fujitsu COBOL

"HeyBub" <heybubNOSPAM@gmail.com> wrote in message
news:13aun1541h6hga6@news.supernews.com...
> Pete Dashwood wrote: 
>
> No apology needed.
>
> An engineer and a mathematician, who both know how to drink from a cup,
> are confronted with a water fountain.
>
> The engineer studies the problem for a moment, then bends over and has a
> refreshing drink.
>
> The mathematician studies the problem for a moment... and  fills his cup!
>
> Engineers are taught to solve new problems directly; mathematicians are
> taught to reduce a new problem to one that has already been solved.
>
> You're an engineer; I'm the other kind. It's the result that counts.

A very  analogy. I think some days I'm more engineer and other days more
mathematician. :-)

I imagine that's probably true for most of us. As you say, it is the result
that matters.

Pete.

--
"I used to write COBOL...now I can do anything."



Report this thread to moderator Post Follow-up to this message
Old Post
Pete Dashwood
07-31-07 11:55 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 09:31 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.