|
From: Stefan H. <he...@ne...> - 2005-07-07 22:37:41
|
Hi, it's possible to compile and run the IBM supplied DB2 COBOL samples using= TC on Windows. First of all, you must compile the COBOL source which contains embedded S= QL with the DB2 precompiler supplied by IBM (included in the free applicatio= n development client package). The precompiler is capable of generating Microfocus COBOL compatible code. This leads to plain COBOL source (witho= ut embedded SQL), which has to be modified for compiling with TC: - TC doesn't support literals as program identifiers - TC requires the STDCALL keyword for DB2 api calls (Microfocus COBOL: SPECIAL-NAMES. CALL-CONVENTION 74 IS DB2API. CALL DB2API "<api function>"= ) - I ran into problems with the precompiler generated "by content" paramet= er passing to the DB2 api. Converting "by content" to "by reference" solved = the problem. Later I found another solution for this problem. When aligning a= nd enlarging the passed structure to word boundary (4 bytes), the "by conten= t" parameter passing can remain unchanged... Last, but not least, you have to link the TC compiled module to the DB2 a= pi libs. These libs are intended for use with Microsoft's Visual C and have = to be converted to Mingw usable libs before (see Mingw faqs). Good luck! I succeeded to compile and run a COBOL program containing embedded (stati= c) SQL and accessing DB2 for z/OS (using DB2 Connect). Best regards Stefan -----Urspr=FCngliche Nachricht----- Von: tin...@li... [mailto:tin...@li...]Im Auftrag von --__--__-- Message: 1 Date: Tue, 5 Jul 2005 21:59:35 -0700 (PDT) From: nikil chakravarthy <nik...@ya...> To: tiny-cobol-users <tin...@li...> Subject: [Tiny-cobol-users] Can i call DB2 database from tinyCOBOL Hi All, I am newbie for tinyCOBOL development. I am struggling with finding information about tinyCOBOL with DB2 database access. Can somebody let me know whether it is possible to connect to DB2 from tinyCOBOL and send me some URL's and resources. Your help is very much appreciated. Looking forward for positive response. Thanks & Regards, Nikil __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --__--__-- Message: 2 Date: Wed, 06 Jul 2005 02:35:56 -0400 From: David Essex <de...@us...> Reply-To: tiny-cobol-users <tin...@li...> To: tiny-cobol-users <tin...@li...> Subject: Re: [Tiny-cobol-users] Can i call DB2 database from tinyCOBOL nikil chakravarthy wrote: > I am newbie for tinyCOBOL development. I am struggling > with finding information about tinyCOBOL with DB2 > database access. Can somebody let me know whether it > is possible to connect to DB2 from tinyCOBOL and send > me some URL's and resources. Your help is very much > appreciated. Looking forward for positive response. TC does not have an SQL pre-processor, thus you can only access any SQL database using the native API, and not using embedded SQL. If DB2 includes an SQL pre-processor for COBOL, and I think it does, the following may (or may not) work. Pass the embedded SQL COBOL program thru the DB2 SQL pre-processor for COBOL. And then using TC, compile it's output adding the appropriate DB2 library(s) in the link step. |