473,804 Members | 3,497 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5130
"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
14912
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 allows me to do that? It should avoid us the work to write a COBOL program that open the COBOL
242
13467
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 comments on past experience, research articles, comments on the matter would be much appreciated. I suspect something like C would be the best based on comments I received from the VB news group. Thanks for the help in advance James Cameron
7
9258
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) that I ftp up to a network folder for processing in .Net. Anyone know if it's possible (and how) to convert those COMP-3 (PIC S9(5)V99 COMP-3, for example) to a numeric of type double/single/et cetera? Hope so, as of now, I'm writing all the fix-it...
15
9574
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 attempted to do this sort of thing using C#? I would love to get rid of my COBOL programmer and especially the code, if I can. Apparently, it is much simplier to edit/parse text reports in COBOL than other languages.... so I'm being told.
1
2870
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, it does not seem that these get replaced by the values they are passed in "as is". Example, if I use @P1 as a parameter, the value sent in is "@P1" literally. Can someone show me an example of calling a COBOL program (not a stored
7
13715
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 reinitialize the addresses and even more when it decides not to do it. Recently I've ben strucked with a problem of host variables defined in LINKAGE SECTION, and it took me some time to find the cause and solution for the problem.
1
3742
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 mainframe data general computer; is there any tool that can convert my cobol program to visual basic or to c c+ or c++ .
2
6419
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 can use either depending on which is more efficient. One of the older posts ("Calling a COBOL Subroutine from COBOL/DB2 Stored Procedure" Dec 2005) suggested this is possible but I couldn't follow the explanation and there wasn't any examples....
0
1390
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 DBI0000. In cobol program, I can access DB2 use the DBI0000 as below. CALL DBI0000 USING PARM-OPTION
0
9571
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10561
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10318
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10302
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6845
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5505
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5639
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4277
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2976
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.