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

FORTRAN to Cobol conversion


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jatinsaraf2501

New User


Joined: 01 Oct 2009
Posts: 2
Location: US

PostPosted: Thu Sep 27, 2012 6:09 am
Reply with quote

Hi,

We want to convert a couple of FORTRAN programs to Cobol. Can you please suggest ways to do that? I see that tools like Prism CS, Datatek can do that but is it possible without a tool? If not, any recommendations on a tool would be helpful.

Thanks.
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: Thu Sep 27, 2012 6:32 am
Reply with quote

FORTRAN REAL variables become COBOL COMP-1, DOUBLE variables become COMP-2, CHARACTER variables become PIC X, and INTEGER variables become PIC S9(09) COMP-5. If you have other variable types, you'd have to look at what to convert them to in COBOL.

As long as you replicate the FORTRAN logic in the COBOL code, the conversion should be pretty straightforward. I've never done such a conversion with a tool, so I don't know anything about conversion tools.
Back to top
View user's profile Send private message
jatinsaraf2501

New User


Joined: 01 Oct 2009
Posts: 2
Location: US

PostPosted: Thu Sep 27, 2012 7:50 am
Reply with quote

Thanks. There are certain AFP calls in FORTRAN like AFPINIT. Do you know the equivalent cobol calls?
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Sep 27, 2012 8:55 am
Reply with quote

Since AFPINIT is an external subroutine/function You will have to ask Your peers about it, or read the application documentation.
Back to top
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Thu Sep 27, 2012 5:48 pm
Reply with quote

You say 2 programs - how big?

If not too big, I would think a manual conversion would be easier/safer/quicker/cheaper/morefun than finding a tool.

If you do not know both languages, it would not be hard to find someone who does, but don't wait much more than 10 years.
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: Thu Sep 27, 2012 6:23 pm
Reply with quote

Phrzby Phil wrote:

If you do not know both languages, it would not be hard to find someone who does, but don't wait much more than 10 years.
Not so sure about that. My 26 year old son, in the course of his Engineering studies, had to learn enough Fortran to understand how to use a large library of pre-existing functions. To help him, I dug up one of the textbooks that *I* used in university back in the 1970s.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic 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