By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,199 Members | 1,458 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,199 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
2 Replies


P: n/a
"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.