Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

First Time User

Status
Not open for further replies.

fabiousa

MIS
Aug 13, 2001
45
BR
Hello guys, this one is really easy.
I used COBOL for sometime in Mainframes and now I need to compile some programas in a PC (Windows NT Service Pack 4). I don't know where to start. I have the source code and the data files. They work somewhere else and now I need to do the same here.

These are my main STUPID questions:

- How do I compile and link-edit the programs?
- In which directory should I put my source code and how to make the compiler point to the right path?
- What's the extension of a object code?
- First I compile the source and then I execute a linkage editor pointing to the same directory?
- Is there any self explanatory compiler available? What version should I get?
- In which directory should the files be defined?
- How does my program recognize the ASSIGN clause? In mainframes we point it to a DDNAME which is associated to a DSN.

Thanks a lot,
Fabio
 
Hi,

it depends on with which computer you are working. Some of them are named COBOL. The compiling process from the commandline works like:

COBOL <source>;

After that, suppose your source is named TEST, the compiler expects the source to bel TEST.CBL or TEST.COB. Test.cbl is without line numbers, test.cob has line numbers.

In DOS the COBOL.EXE file should be in the path. You can assign a path by setting it, the best in a batch file with something like:

PATH=%PATH%;C:\cobol;

expecting that your cobol compiler is in the directory c:\cobol. The path=%path% takes over the previous path.

If you have a work-bench, it is much easier. You just follow the interaction.

Linking is going in a similar way. LINK <object>; The linkage editor will use some libraries, usual with the extension .LIB

If you have static called modules, you need to link them with the mainprogram. So if you link the mainprogram, you say something like:

LINK <mainobject+calledobj1+calledobj2>

In the old dos environment, the names should not be longer than 8 positions.

I think as being a mainframe man, it is easy to use CA-REALIA COBOL. Their workbench works good, has an interactive debugger and the process is much simular as on the mainframe, almost no funny pc stuff.

If you want to assign a file in REALIA, you have 3 ways:

1) In your program you don't change a thing and you assign to the dd-name you are used to. In DOS you say before starting the program something like:

SET MYDDNAME=C:\WORK\MYFILE.TXT

Your program will understand how to assign the dd-name MYDDNAME to the file C:\WORK\MYFILE.TXT

2) you can assign to a file:

...... ASSIGN TO &quot;C:\WORK\MYFILE.TXT&quot;

3) ASSIGN TO VARYING A

01 A PIC X(79) VALUE &quot;C:\WORK\MYFILE.TXT&quot;.

It does not matter how you fill the variable A, for example with an accept....

I hope this gives you an idea. I did a lot of programming on PC and mainframe and usualy it is easer - because you are your own boss - on the PC.

Greetings,

Crox
 
crox,

Thanks a lot, I will try it as soon as I get a chance!
It seems to be very interesting.

cheers,
Fabio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top