473,835 Members | 1,714 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Stored Procedures and COBOL

1 New Member
How can I call a stored procedure when one of the parameters is a cursor? Shouldn't the COBOL code looks something like this? :

Expand|Select|Wrap|Line Numbers
  1. EXEC SQL
  2.     CALL CMQRACIN(<what do i place here?> :S-FINANCE-IN-DATA.ACCT-ID);
  3. END-EXEC
  4.  
By the way, the stored procedure looks like this:

Expand|Select|Wrap|Line Numbers
  1.  
  2. CREATE OR REPLACE PROCEDURE Cmqracin (P_REP_CURSOR IN OUT Cr_Package.CR_CURSOR, P_ACCT_ID IN CHAR) 
  3. IS
  4.  
  5. BEGIN
  6.  
  7.   DECLARE
  8.  
  9. ...
  10.  
  11. --Write the output fields
  12. OPEN P_REP_CURSOR FOR
  13. SELECT
  14.   CM_PAST_DUE_AMT CM_PAST_DUE_AMT,
  15.   CM_PAST_AMT_DUE_DT CM_PAST_AMT_DUE_DT,
  16.   CM_CURR_DUE_AMT CM_CURR_DUE_AMT,
  17.   CM_CURR_AMT_DUE_DT CM_CURR_AMT_DUE_DT,
  18.   CM_ACCT_BAL CM_ACCT_BAL,
  19.   CM_LAST_PAYM_DT CM_LAST_PAYM_DT,
  20.   CM_LAST_PAYM_RCVD CM_LAST_PAYM_RCVD,
  21.   RCR_CHG_AMT RCR_CHG_AMT,
  22.   CM_CASH_ONLY_IND CM_CASH_ONLY_IND,
  23.   CM_PASSW0RD CM_PASSW0RD,
  24.   CM_NEXT_PAYM_DT CM_NEXT_PAYM_DT,
  25.   CM_KEY_ACCT_ROLE CM_KEY_ACCT_ROLE,
  26.   INSTALL_DT INSTALL_DT
  27. FROM
  28.   DUAL;
  29.  
  30. END;
  31.  
Also, if i get pass the problem of the cursor being passed, how will i be able to retrieve the data from the cursor? Should the code look like an open, fetch, then close type of COBOL SQL call?
Sep 18 '06 #1
0 2534

Sign in to post your reply or Sign up for a free account.

Similar topics

5
3983
by: Scott Sauyet | last post by:
If this is not the appropriate forum, could someone please let me know? Thanks. I'm part of a very heterogeneous distributed development team, and a clash of cultures is causing some very significant problems. It's taking us far too long to get the people with the proper permissions to compile and bind COBOL stored procedures on our MVS DB2 test and deployment environments. The bureaucratic hurdles to getting these permissions...
2
5007
by: Thomasb | last post by:
Hi! In our company we have a huge amount of COBOL sub-routines that are called from other COBOL-programs. Now we are looking for a method to call them from Windows/Web applications. One idea is to wrap the sub-routine call in a DB2 stored procedure and call the procedure from our Web application.
5
2144
by: Rhino | last post by:
This question relates to DB2 Version 6 on OS/390. Can a (COBOL) stored procedure on this platform do file I/O, i.e. write to a sequential file? I am trying to debug a stored procedure. As far as I know, DB2 stored procedures cannot do terminal I/O on any operating system but I know that (Java) stored procedures in Windows/Linux/Unix can write to files and I have done this many times.
2
1434
by: singlal | last post by:
Hi, my question was not getting any attention because it moved to 2nd page; so posting it again. Sorry for any inconvenience but I need to get it resolved fast. Need your help! **************************************************************************************************** Original Question: -------------------- Has anyone called a COBOL subroutine using COBOL CALL from a COBOL/DB2
1
5720
by: JLE | last post by:
I'm new to stored procedures, however, the passing of parameters using a group item in the calling cobol program seems incorrect to me. Would this work? Calling COBOL pgm is calling a stored procedure using a group 01 level and the receiving COBOL procedure has 01 levels for each parameter. Environment is z/OS, DB2, CICS, COBOL, LE. The procedure is local using WLM. DB2 version is 7.x and CICS is TS 2.2, I think.
4
3997
by: nishi57 | last post by:
I hope I can get some help regarding this issue, which has been going on for a while. I have a desktop user who is having problem running "Stored Procedures". The DB2 Connect application works fine but when he runs the stored procedure, he gets the following error message. "SYSPROC".CSGCSB54 - Run started. Data returned in result sets is limited to the first 100 rows. Data returned in result set columns is limited to the first 20...
0
2068
by: balaji krishna | last post by:
Hi, I need to handle the return set from COBOL stored procedure from my invoking Java program. I do not know, how many rows the stored proc SQL fetches.I have declared the cursor in that proc, but i don't know how to return the rows the cursor has opened and I don't know how to handle the return set from the proc in my java code. My main problem with that proc is that whether I can retun the result set from the proc without closing the cursor...
0
5806
by: pompeyoc | last post by:
I am trying to learn how to use stored procedures written in COBOL so I wrote 2 small programs to test it out: the stored procedure and the the calling program. I have no problems compiling them but when the calling program enters the SP, it either hangs or gives me sqlcode -1131. We are on AIX 5.2 (I think) running DB2 UDB ver 7.2 and MF COBOL 4.1. Below are the programs I wrote:
4
3143
by: PJackson | last post by:
I have been given the task of taking a 3,200 line COBOL stored procedure and duplicating the same functionality in UDB 7.2 on the Windows platform with a procedural SQL stored procedure. I have fiddled with procedural SQL stored procs on UDB, but mostly short,trivial ones. Looking for good advice, links, etc. on the best approach to this. There doesn't seem to be the concept of subroutines within a stored proc, so I am guessing one main...
1
2894
by: rsreeni | last post by:
Hi, We are planning to use Cobol Stored procedures for doing our Data retrieval from DB2 Tables. The stored procedure(s) will be called from J2EE application via Db2 Connect. Does the linkage restriction of 32K apply to the parameters getting passed into COBOL DB2 Stored procedures also? Thanks, -Sreeni
0
10811
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
10233
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9345
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7766
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6966
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
5804
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4434
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
2
3993
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3088
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.