IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Doubt with cobol compiler


IBM Mainframe Forums -> COBOL Programming
Post new topic   This topic is locked: you cannot edit posts or make replies.
View previous topic :: View next topic  
Author Message
Pankaj Gupta
Currently Banned

New User


Joined: 07 May 2008
Posts: 50
Location: Bangalore

PostPosted: Tue Feb 08, 2011 4:35 am
Reply with quote

Hello,

We are having some old Fortran programs which we are needing to be compiling as Cobol II so that we may be calling them from our cobol II programs.

But when we are compiling we are getting a very many errors.

Is it perhaps being that we are needing to specify a compiling option so that the compiler is knowing that the cobol will here be coming from fortrans?

Thanks you.
Back to top
View user's profile Send private message
david jackson

New User


Joined: 24 Jan 2011
Posts: 22
Location: California

PostPosted: Tue Feb 08, 2011 4:43 am
Reply with quote

I think you need to explain in more detail what you are trying to accomplish because my interpretation of your comments seems to suggest you are trying to compile old FORTRAN source code in a COBOL compiler... which you clearly cannot do.

I apologize if I have misunderstood your comments.
Back to top
View user's profile Send private message
Pankaj Gupta
Currently Banned

New User


Joined: 07 May 2008
Posts: 50
Location: Bangalore

PostPosted: Tue Feb 08, 2011 4:58 am
Reply with quote

Thank you sir.

Yes, we are having fortran programs and now these we wish to compile as cobol code so we can be using them in our cobol systems.

If you can be elaborating on the compiling options or what it may be that is wrong it will be helping us in a big manner.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Feb 08, 2011 5:10 am
Reply with quote

Quote:
yes, we are having fortran programs and now these we wish to compile as cobol code so we can be using them in our cobol systems.

ok for the language barrier... but too much is too much icon_cool.gif

how in heaven do You expect that the cobol compiler would understand fortran ?

repeat with me ..
the c compiler understands c
the pl1 compiler understands pl1
the fortran compiler understands fortran
tne cobol compiler understands cobol ...

the <some other language> compiler understands that <some other language>

before using a cobol compiler to compile fortran code,
it would be better to transform fortran code in cobol code
so that the compiler has a chance to understand it !

do You realize that also between compiler and code might exist a language barrier !
Back to top
View user's profile Send private message
david jackson

New User


Joined: 24 Jan 2011
Posts: 22
Location: California

PostPosted: Tue Feb 08, 2011 5:11 am
Reply with quote

I was really hoping I had misunderstood your comments..

FORTRAN is a Programming Language - FORmual TRANslation.
COBOL is Programming Language - COmmon Business Oriented Language

Each have totally different compilers and different language syntax.

You cannot take FORTRAN code and expect to put it through a COBOL Compiler. No wonder you are getting errors.

You will most likely need to rewrite your old FORTRAN programs from scratch in a newer version of COBOL that provides those equivalent mathematical functions.
Back to top
View user's profile Send private message
Pankaj Gupta
Currently Banned

New User


Joined: 07 May 2008
Posts: 50
Location: Bangalore

PostPosted: Tue Feb 08, 2011 5:27 am
Reply with quote

If I am understanding you in right fashion then we must be using a fortran compiler to produce our cobol code. We mustbe having the machine codes in cobol if out will be running on the mainframes. I will make the enquiries pertaining to the fortran compiler.
Thank you for solving this doubt
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Feb 08, 2011 5:41 am
Reply with quote

Quote:
If I am understanding you in right fashion then we must be using a fortran compiler to produce our cobol code

No You are undertanding wrong!
cobol, fortran, pkl1,c,c++ are languages to write programs.

a source program when processed by the proper compiler produces machine code <objects>
which later are processed by the linkage editor( binder in the latest terminology)
to produce load ( executable) modules

a fortran compiler will never be able to produce cobol code,
it will produce an object...
Back to top
View user's profile Send private message
david jackson

New User


Joined: 24 Jan 2011
Posts: 22
Location: California

PostPosted: Tue Feb 08, 2011 5:43 am
Reply with quote

You are getting totally mixed up.

FORTRAN does NOT produce COBOL code.

When any program is compiled and link-edited - whether it is Fortran, COBOL or Assembler etc , it all gets converted into executable "machine code".

I suggest you go back and take a look at the POP manual to get a better understand of the architecture.

Do not go looking for a Fortran compiler until you understand the concepts.
Back to top
View user's profile Send private message
Pankaj Gupta
Currently Banned

New User


Joined: 07 May 2008
Posts: 50
Location: Bangalore

PostPosted: Tue Feb 08, 2011 5:47 am
Reply with quote

We are not doing the oriental object programming, merely we are needing standard mainframes cobol machine code.
Back to top
View user's profile Send private message
david jackson

New User


Joined: 24 Jan 2011
Posts: 22
Location: California

PostPosted: Tue Feb 08, 2011 6:04 am
Reply with quote

Pankaj Gupta wrote:
We are not doing the oriental object programming, merely we are needing standard mainframes cobol machine code.


Nothing to do with Object Oriented concepts.

You need to understand that a Fortran compiler compiles Fortran source code and a Cobol compiler compiles Cobol source code. The end result from both compile and links is executable machine code.

As I suggested earlier, you may need to have somebody rewrite your old Fortran code from scratch into new COBOL code.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Feb 08, 2011 6:14 am
Reply with quote

Quote:
We are not doing the oriental object programming, merely we are needing standard mainframes cobol machine code.

plain horse manure
as opposed to
western sequential programming and customized fortran source
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Feb 08, 2011 6:14 am
Reply with quote

You cannot compile FORTRAN programs with a COBOL compiler! Period.

Would you compile BASIC programs with a C++ compiler? Would you expect the output to make sense? That is what you are attempting when you comjpile FORTRAN programs with a COBOL compiler. The syntax is completely different, the languages use different rules for pretty much everything, and simply put there's no way to do it. You must rewrite the FORTRAN code into COBOL in order to compile it -- and as someone who has written plenty of FORTRAN over the years, I can tell you that is not necessarily an easy thing to do.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue Feb 08, 2011 6:38 am
Reply with quote

have fun for a while....
the topic will be deleted in a couple of days
just a waste of time and resources to keep alive this concentrate of nitrogenated equine leavings
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Feb 08, 2011 7:09 am
Reply with quote

Hello,

Quote:
We are not doing the oriental object programming, merely we are needing standard mainframes cobol machine code.
You are demonstrating once again that you do not have the basic foundation to do this. . .

There is no such thing as "standard mainframes cobol machine code". In the cobol environment, you compile the the source with a cobol compiler which creates an object module which is used as part of the input to the link-edit to generate what is known as a "load module" - which is the code that is executed by the mainframe.

This same process is followed when the source is fortran code. You must use a fortran compiler. . .

If you have a bunch of fortran code and you want to no longer support fortran, you have to convert the fortran source to cobol source. Then you can compile using the cobol compile process.

This will not be a trivial task and - as you've been told several times previously - the organization needs to hire/rent some quailfied "helpers".
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Tue Feb 08, 2011 7:21 am
Reply with quote

I am beginning to wonder if these questions are a prank.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Feb 08, 2011 7:29 am
Reply with quote

don.leahy wrote:
I am beginning to wonder if these questions are a prank.
Hi Don,

I fear not. . . Take a look at other topics from the same poster. . .

d
Back to top
View user's profile Send private message
Pankaj Gupta
Currently Banned

New User


Joined: 07 May 2008
Posts: 50
Location: Bangalore

PostPosted: Tue Feb 08, 2011 1:49 pm
Reply with quote

Thank You all. If I am now fully comprehending then we are knowing that for the Fortrans we are using for the best a Fortran compiler. Itis not as we are thinking that the cobol compiler is compiling all the languages for the mainframes environment. We have simply here an issue of clarifications and terminologies. I will be seeking now a Fortrans compiler and then if there are being further doubts I will be seeking your kind help in your fortrans forum.

Thankyou all again for your kind helping.
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Wed Feb 09, 2011 2:30 am
Reply with quote

Pankaj Gupta wrote:
We are not doing the oriental object programming, merely we are needing standard mainframes cobol machine code.

Oriental object programming.... it reminds me of the IBM invented language APL. It could possibly be described as Greek object programming. icon_eek.gif
Quote:
I will be seeking now a Fortrans compiler and then if there are being further doubts I will be seeking your kind help in your fortrans forum.

To my knowledge, there is no Fortran section in this excellent forum. There may be Fortran programmers around here, but chances are that you are more or less on your own. My own Fortran experience is very limited , dating back to the seventies where I coded and implemented 2 modules on a HP1000 computer.
Back to top
View user's profile Send private message
Pankaj Gupta
Currently Banned

New User


Joined: 07 May 2008
Posts: 50
Location: Bangalore

PostPosted: Wed Feb 09, 2011 2:58 am
Reply with quote

We have now been fortunate in locating our fortrans compile jcls and all was seeming fine.

But when we are adding our new cobol code to the fortrans then it is no longer compiling without an error. This is being exceedingly tiresome to get done a small job. We cannot be using the normal cobol compiler because there is being fortrans, but when we are using the fortrans compiler then it is now not compiling also.
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Wed Feb 09, 2011 3:16 am
Reply with quote

You have added some Cobol code into your Fortran source code decks???!!?? icon_eek.gif icon_rolleyes.gif

Don't do that!

Now your source code will not compile in neither Cobol nor Fortran compilers. If you must modify the Fortran code, code in Fortran, and compile it with the Fortran compiler.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Feb 09, 2011 3:24 am
Reply with quote

Quote:
But when we are adding our new cobol code to the fortrans then it is no longer compiling without an error.
What was the rationale behind this. . . icon_confused.gif (No answer needed).

After this demonstration that the topic is exhausted, it is being locked. . .

No learning is happening and there is little/no entertainment value. . . icon_sad.gif

d
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Feb 09, 2011 3:27 am
Reply with quote

Quote:
But when we are adding our new cobol code to the fortrans then it is no longer compiling without an error.


what is the average IQ in the company You work for?
certainly an amoeba will score more icon_evil.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies. View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts How I Found a Bug in a FORTRAN Compiler All Other Mainframe Topics 4
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top