Can't Save .cob

Get help with the installation and running of the Zeus IDE. Please do not post bug reports or feature requests here. When in doubt post your question here.
marcrowd
Posts: 8
Joined: Sat Jul 05, 2014 2:38 am

Can't Save .cob

Post by marcrowd »

I'm trying to teach myself cobol and I can't figure how this thing works. I'm kind of starting from scratch, so this is probably super simple but I'm not figuring it out. I am needing to save a .cob; then I need to know how to get it into a workspace; and then I need to figure out how to run it. I apologize if it's in the video tutorials and I missed it on youtube, but I am just totally lost. THanks!
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

I am needing to save a .cob;

1) Select the Templates section of the Navigator (on the left)
2) Select the COBOL Document Type
3) Click on the New File option
4) Use the File, Save As menu and save the file to: c:\temp\test.cob
then I need to know how to get it into a workspace;

1) Workspace, New menu to create a new workspace
2) Open c:\temp\test.cob and use the File, Add to Active Project menu. Also see here: http://www.zeusedit.com/zforum/viewtopic.php?t=7066
then I need to figure out how to run it.
Before you can run anything you need to compile and link the COBOL file to produce and executable.

What COBOL compiler have you installed :?:

Cheers Jussi
marcrowd
Posts: 8
Joined: Sat Jul 05, 2014 2:38 am

Zeus, not a compiler? What should I get?

Post by marcrowd »

What COBOL compiler have you installed
I thought Zeus was a compiler.

I've been watching https://www.youtube.com/watch?v=bqExtGo ... nB&index=1
and he uses IDE Cobol that looks like it does everything all in one. I tried to install something that I thought was that program and it said that it wasn't compatible to my Windows 8 computer. So I got Zeus IDE and I guess I didn't know I needed a compiler as well.

Any suggestions for a compiler? And how do I get them to work together?
marcrowd
Posts: 8
Joined: Sat Jul 05, 2014 2:38 am

Downloaded OpenCOBOL 2.2 dev 2012

Post by marcrowd »

Just do this:

Options, Document Types menu
Select and edit the COBOL Document type
Select the Compiler panel
In the command line field add the command line shown below
Code:
C:\MinGW\local\bin\htcobol.exe "$fn"

You can also add any additional command line options. For MORE options see here: http://tiny-cobol.sourceforge.net/docs/htcobol_en.html
Open a COBOL document and use the Compiler, Compile to compile and build that file
The above steps should create an executable in the same folder. You should check that this is the case.

If you now want to run that executable do this one off configuration to create a Tool item to run the executable:
Options, Document Types menu
Select and edit the COBOL Document type
Select the Tools panel
Setup this new tool:
Code:
Menu Text: Execute: '$fb.exe'
Program Type: Executable
PROGRAM Name: $fb.exe
Arguments:
Work Directory: $fdd

Turn on Capture Standard Output and Capture Standard Error options

Add the item to the different menus as required

This will add a tool item to the Navigator, Tools panel (left side of editor).

After you have compiled your COBOL file you can now run the executable for that file from the Tools panel. To run the executable make sure the COBOL document is active and then use this new Tool item to do the run.

The output of the program should also get captured inside of Zeus.
I downloaded OpenCOBOL 2.2 dev 2012 from one the list of compilers on one of your other responses but I'm trying to follow your instructions to get them to work in my situation.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Towards the end of this topic you will see a more detail set of instructions on getting TinyCobol to work with Zeus:

http://www.zeusedit.com/zforum/viewtopic.php?t=2393

I found this page that has a link to a Windows installer for the GNU Cobol (formerly known as OpenCOBOL):

The direct link to the installer is here.

Cheers Jussi
marcrowd
Posts: 8
Joined: Sat Jul 05, 2014 2:38 am

Good so far...

Post by marcrowd »

Everything you've given me so far has been gold. Got TinyCobol. Got my document to Compile successfully. It does say this when I compile it along with the successful message:

C:\MinGW\local\bin\htcobol.exe: Could not find input file for 'C:\Users\Mark\AppData\Local\Temp\First-attempt' using search suffixes '.cob;.COB;.cbl;.CBL;'. Abort.

Also, when i select the executable file under the Tools tab within the navigation section, it makes a loud sound like 'you did something wrong' and brings up a blank debug screen that has this in it

---------------------------------------------------------------------------
Zeus - Version 3.97t
Copyright (c) Xidicone P/L 1993-2014. All rights reserved.
---------------------------------------------------------------------------
**** Unregistered Software. To be used for evaluation purposes only. ****
---------------------------------------------------------------------------


Let me know if you can work anymore of your "the force" magic and get me all the way home. Thanks!
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Got my document to Compile successfully.
Even though Zeus might be saying the compile was successful I don't think that is the case :(

To determine the success or otherwise of a compile, all Zeus does is try to parse the compiler output for any sign of problems.

By default that is nothing more than a check for any indication of errors and/or warnings.

As you can see from the output produced, in terms of English it seems clear it has failed, but the based on the text of that output, Zeus would have seen it as a success.
C:\MinGW\local\bin\htcobol.exe: Could not find input file for 'C:\Users\Mark\AppData\Local\Temp\First-attempt' using search suffixes '.cob;.COB;.cbl;.CBL;'. Abort.

This line says to me that TinyCobol (i.e. htcobol.exe) could not find this file:

Code: Select all

C:\Users\Mark\AppData\Local\Temp\First-attempt
It also says it tried all of these file extensions:

Code: Select all

C:\Users\Mark\AppData\Local\Temp\First-attempt.cob
C:\Users\Mark\AppData\Local\Temp\First-attempt.COB
C:\Users\Mark\AppData\Local\Temp\First-attempt.cbl
C:\Users\Mark\AppData\Local\Temp\First-attempt.CBL
Does a file with any of those combinations of extension actually exists :?:

If the file does exists then it indicates the command line defined in the Zeus COBOL document type is probably wrong. Is this the command line you have defined :?:

Code: Select all

C:\MinGW\local\bin\htcobol.exe -M "$fn"

My first guess as an alternative command line would be this instead:

Code: Select all

C:\MinGW\local\bin\htcobol.exe -M "$fdd$fb"

That is sending the file name to the compiler without the extension and letting the COBOL compiler add the extension.

Finally, to better understand why this is failing I would use the Options, Editor Options menu and in the General panel turn on the Debug tools, macros and executables checkbox option.

With this option on you will see exactly what command line Zeus is sending to the htcobol.exe compiler.

Post back that command line and I will be able to help you fix this ;)

Cheers Jussi
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

Details on how to use the GNU Cobol compiler inside Zeus can be found here: http://www.zeusedit.com/zforum/viewtopic.php?t=7174

Cheers Jussi
marcrowd
Posts: 8
Joined: Sat Jul 05, 2014 2:38 am

This is what I got from the changes to the command line...

Post by marcrowd »

---------------------------------------------------------------------------
Zeus - Version 3.97t
Copyright (c) Xidicone P/L 1993-2014. All rights reserved.
---------------------------------------------------------------------------
**** Unregistered Software. To be used for evaluation purposes only. ****
---------------------------------------------------------------------------

Debug: Changed to the 'C:\Users\Mark\AppData\Local\Temp\' directory supplied
Debug: Command: C:\MinGW\local\bin\htcobol.exe -M "C:\Users\Mark\AppData\Local\Temp\C:\Users\Mark\AppData\Local\Temp\First-attempt"
Debug: stdout: yes
Debug: stderr: yes
Debug: save: no
Debug: save all: no
Debug: prompt: no
Debug: reload: no
Debug: output: no
--------------------Configuration: Practice Programs - Release--------------------
Using document type compiler options....

Debug: Command: C:\WINDOWS\system32\cmd.exe /c C:\MinGW\local\bin\htcobol.exe -M "C:\Users\Mark\AppData\Local\Temp\C:\Users\Mark\AppData\Local\Temp\First-attempt"
Debug: Process ID: 0x2F54

C:\MinGW\local\bin\htcobol.exe: Could not find input file for 'C:\Users\Mark\AppData\Local\Temp\C:\Users\Mark\AppData\Local\Temp\First-attempt' using search suffixes '.cob;.COB;.cbl;.CBL;'. Abort.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

So as per the error message do any of these files exist :?:

Code: Select all

C:\Users\Mark\AppData\Local\Temp\C:\Users\Mark\AppData\Local\Temp\First-attempt.cob
C:\Users\Mark\AppData\Local\Temp\C:\Users\Mark\AppData\Local\Temp\First-attempt.COB
C:\Users\Mark\AppData\Local\Temp\C:\Users\Mark\AppData\Local\Temp\First-attempt.cbl
C:\Users\Mark\AppData\Local\Temp\C:\Users\Mark\AppData\Local\Temp\First-attempt.CBL
Cheers Jussi
marcrowd
Posts: 8
Joined: Sat Jul 05, 2014 2:38 am

Post by marcrowd »

I thought I had. I resaved it by changing the file type and still got this:
---------------------------------------------------------------------------
Zeus - Version 3.97t
Copyright (c) Xidicone P/L 1993-2014. All rights reserved.
---------------------------------------------------------------------------
**** Unregistered Software. To be used for evaluation purposes only. ****
---------------------------------------------------------------------------

Debug: Changed to the 'C:\Users\Mark\AppData\Local\Temp\' directory supplied
Debug: Command: C:\MinGW\local\bin\htcobol.exe -M "C:\Users\Mark\AppData\Local\Temp\C:\Users\Mark\AppData\Local\Temp\First-attempt.cob"
Debug: stdout: yes
Debug: stderr: yes
Debug: save: no
Debug: save all: no
Debug: prompt: no
Debug: reload: no
Debug: output: no

Using document type compiler options....

Debug: Command: C:\WINDOWS\system32\cmd.exe /c C:\MinGW\local\bin\htcobol.exe -M "C:\Users\Mark\AppData\Local\Temp\C:\Users\Mark\AppData\Local\Temp\First-attempt.cob"
Debug: Process ID: 0x2644

C:\MinGW\local\bin\htcobol.exe: Could not find input file for 'C:\Users\Mark\AppData\Local\Temp\C:\Users\Mark\AppData\Local\Temp\First-attempt.cob' using search suffixes '.cob;.COB;.cbl;.CBL;'. Abort.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

The is the command that Zeus is running and as you can see it is clearly wrong:

Code: Select all

Debug: Command: C:\MinGW\local\bin\htcobol.exe -M "C:\Users\Mark\AppData\Local\Temp\C:\Users\Mark\AppData\Local\Temp\First-attempt.cob" 

This means the compiler settings in the COBOL document type are not correct.

The compiler setting should be this:

Code: Select all

C:\MinGW\local\bin\htcobol.exe -M "$fn"
Cheers Jussi
marcrowd
Posts: 8
Joined: Sat Jul 05, 2014 2:38 am

Not working...

Post by marcrowd »

That's what I had. I'm not sure what I'm doing wrong on this. I know it's something simple. Here are the new errors:

Code: Select all

Using document type compiler options....

Debug: Command: C:\WINDOWS\system32\cmd.exe /c C:\MinGW\local\bin\htcobol.exe -M "C:\Users\Mark\AppData\Local\Temp\First-attempt.cob"
Debug: Process ID: 0x33A0

'as.exe' is not recognized as an internal or external command,
operable program or batch file.
Compilation completed with errors.
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

'as.exe' is not recognized as an internal or external command

This means that the MinGW is not installed or is not in the path.

To see if the file is on the machine run this command line from inside Zeus (using the Tools, DOS Command Line menu) or at the Windows command line prompt:

Code: Select all

  Command: dir as.exe /s
Directory: c:\
See Step (5) of this link: http://www.zeusedit.com/zforum/viewtopic.php?t=7175

and especially these MinGW install steps: http://www.zeusedit.com/zforum/viewtopic.php?t=6957
That's what I had. I'm not sure what I'm doing wrong on this. I know it's something simple.

TinyCOBOL is a real pain to install only because it is not self contained and is missing several parts and those parts have to be installed individually.

I would continue with the TinyCOBOL install, only since you have got this far and in the process you are learning how Windows executables work ;)

But I found the GNU Cobol much easier to get working: http://www.zeusedit.com/zforum/viewtopic.php?t=7174

That would be my suggested as a better COBOL toolset.

Cheers Jussi
marcrowd
Posts: 8
Joined: Sat Jul 05, 2014 2:38 am

New error...

Post by marcrowd »

Ok this is my latest error message....

Code: Select all

Debug: Command: C:\WINDOWS\system32\cmd.exe /c C:\OpenCobol\
Debug: Process ID: 0x1978

'C:\OpenCobol\' is not recognized as an internal or external command,
operable program or batch file.
Post Reply