473,396 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

anyone who has Converted COBOL program to C/C++(mainframe)

I am on a project where I am converting COBOL to C++ on the mainframe.
I am new to COBOL and have a lot of questions - any websites or any
suggestions from experienced people will be really appreciated.
My main issue is with the CALL routine - I have to call a external function
which I believe is Assembly. Right now the call is made using 4 structures
in COBOL.
To convert to C++ - what should I be concerned about, should I pass 4
structures as input - what should I look for during data conversion.
Any input with the conversion would be very very helpful.

Thanks,
Kalpana
Jul 19 '05 #1
2 5097
"Kalpana Shridhar" <so***********@compuware.com> writes:
I am on a project where I am converting COBOL to C++ on the mainframe.
I am new to COBOL and have a lot of questions - any websites or any
suggestions from experienced people will be really appreciated.
My main issue is with the CALL routine - I have to call a external function
which I believe is Assembly. Right now the call is made using 4 structures
in COBOL.
To convert to C++ - what should I be concerned about, should I pass 4
structures as input - what should I look for during data conversion.
Any input with the conversion would be very very helpful.


This is slightly off-topic in clc++, since the C++ standard doesn't
define any COBOL compatbility features - you might have more luck in a
COBOL group. This will always be platform-specific, anyway, so maybe a
group dedicated to the particular mainframe (you didn't say which).

Whatever, the trick will be ensuring memory-layout compatability
between the COBOL structures and the corresponding C structures. I say
C structures because you can't add much C++ stuff to a struct before
you lose any control of the memory layout. I did some stuff along
these lines a few years ago, and the COBOL compiler's reference manual
was very informative about memory layout of the various data types. I
would also suggest examining the raw data from the COBOL structures
(e.g. in a debugger or by writing to a binary file) to double-check
that you understand the layout. Then again, if you have the assembly
sources, you could use them to find out where everything goes. You
might need some C-compiler specific stuff to control structure
padding/packing.

--
Raoul Gough
"Let there be one measure for wine throughout our kingdom, and one
measure for ale, and one measure for corn" - Magna Carta
Jul 19 '05 #2
When calling an Assembler subroutine, it often depends on the platform
you're using. My experience has ben with IBM mainframes running DOS/VSE and
MVS.

IBM uses a standard calling routine for communicating between different
programs. Certain registers are used for particular functions. The main
thing I believe you would have to be concerned about is passing in the data
to the subroutine. As I recall, the 31-bit address for each parameter in
the CALL statement is appended together. Therefore, if you are calling with
four arguments, you would be passing in a 16-byte area (4 4-byte addresses)
to the Assembler routine. The last address should have the high order
(x80000000) bit set to 1. This is how the calling routine recongnizes that
it's the last address.

If you are using the C++ compiler on the same mainframe as the existing
COBOL and Assembler code, there should be manuals somewhere that describe
how to call an Assembler routine from a C++ function. That may be your best
bet in the situation.

HTH,

Paul
"Kalpana Shridhar" <so***********@compuware.com> wrote in message
news:3f********@10.10.0.241...
I am on a project where I am converting COBOL to C++ on the mainframe.
I am new to COBOL and have a lot of questions - any websites or any
suggestions from experienced people will be really appreciated.
My main issue is with the CALL routine - I have to call a external function which I believe is Assembly. Right now the call is made using 4 structures
in COBOL.
To convert to C++ - what should I be concerned about, should I pass 4
structures as input - what should I look for during data conversion.
Any input with the conversion would be very very helpful.

Thanks,
Kalpana

Jul 19 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Batista, Facundo | last post by:
People: I'm trying to convert my father from using COBOL to Python, :) One difficult thing we stuck into is how to read, from python, files written with COBOL. Do you know a module that...
242
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
7
by: Mythran | last post by:
No Cobol.Net yet? Wha?!? Anywho, hope someone is familiar enough with Cobol to help me out here. I have some files written by COBOL applications that contain COMP-3 fields (on a mainframe)...
15
by: dm1608 | last post by:
We have a number of COBOL programs, and some were currently developing, that simply read TEXT based reports and scrap the reports for various information. I'm curious to know if anyone has...
1
by: John Bailo | last post by:
I'm able to call a COBOL program directly using the iDB2 .NET native provider and run it if I hard code the parameters. However, I want to use InputOutput parameters to return values. However,...
7
by: misha | last post by:
Hello. I was wandering if someone could explain to me (or point to some manual) the process of mapping the addresses of host variables by DB2. Especially I would like to know when DB2 decides to...
1
by: michel abboud | last post by:
hello , i have a lot of software commercial packages made in cobol language but this ( cobol ) language is not used anymore thousands of programs will be rejected with my...
2
by: pompeyoc | last post by:
Hi, I am a newbie when it comes to stored procs and i would like to learn how to call a COBOL program from a stored procedure. The SP can either be an DB2 SQL SP or an external COBOL/DB2 SP. I...
0
by: kick2006 | last post by:
Hi guys: I am a mainframe cobol programmer, and now i need some helps. I want to write a cobol subroutine it can provide functions for accessing DB2. ex. there is a subroutine called...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.