472,962 Members | 2,525 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

CREATE FUNCTION with COBOL doesn't work!!

1
We have z/os and DB/2 V. 8 running. I try to create a new UDF using the command CREATE FUNCTION:
CREATE FUNCTION CNGETADR (INTEGER)
RETURNS CHAR(50)
EXTERNAL NAME CNADR001
PARAMETER STYLE DB2SQL
WLM ENVIRONMENT WLMENV
LANGUAGE COBOL
DETERMINISTIC
NO SQL
NO DBINFO
NO EXTERNAL ACTION

This was OK (return code 0).

How exactly is the parameter passed to the COBOL-Programme CNADR001? I found two different manuals both from IBM:
http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp?topic=/com.ibm.db2.udb.doc/ad/r0009191.htm
and
ftp://ftp.software.ibm.com/ps/products/db2/info/xplatsql/pdf/en_US/cpsqlrv2.pdf (see Appendix L).
The information in the manuals differs in the sizes of some the the parameters that are passed to COBOL.

My COBOL-Programme CNADR001 I tried both ways:
1)

********************************
LINKAGE SECTION.
********************************
*
01 PARAM-LIST.
05 PARAM-IN PIC S9(9) BINARY.
05 PARAM-OUT PIC X(50).
05 PARAM-IN-IND PIC S9(4) BINARY.
05 PARAM-OUT-IND PIC S9(4) BINARY.
05 PARAM-SQLSTATE PIC X(05).
05 PARAM-QUAL-F-N.
10 PARAM-QFN-LEN PIC S9(4) COMP.
10 PARAM-QFN-DATA PIC X(257).
05 PARAM-SPEC-NAME.
10 PARAM-SN-LEN PIC S9(4) COMP.
10 PARAM-SN-DATA PIC X(18).
05 PARAM-DIAGNOS.
10 PARAM-DIA-LEN PIC S9(4) COMP.
10 PARAM-DIA-DATA PIC X(70).
*
01 PARAM-RUECK.
05 PARAM-OUT-DATA PIC X(50).

*********************************
PROCEDURE DIVISION USING PARAM-LIST
RETURNING PARAM-OUT-DATA.
...

2)

********************************
LINKAGE SECTION.
********************************
*
01 PARAM-LIST.
05 PARAM-IN PIC S9(9) BINARY.
05 PARAM-OUT PIC X(50).
05 PARAM-IN-IND PIC S9(9) BINARY.
05 PARAM-OUT-IND PIC S9(9) BINARY.
05 PARAM-SQLSTATE PIC X(05).
05 PARAM-QUAL-F-N.
10 PARAM-QFN-LEN PIC S9(4) COMP.
10 PARAM-QFN-DATA PIC X(517).
05 PARAM-SPEC-NAME.
10 PARAM-SN-LEN PIC S9(4) COMP.
10 PARAM-SN-DATA PIC X(128).
05 PARAM-DIAGNOS.
10 PARAM-DIA-LEN PIC S9(4) COMP.
10 PARAM-DIA-DATA PIC X(70).
*
01 PARAM-RUECK.
05 PARAM-OUT-DATA PIC X(50).

*********************************
PROCEDURE DIVISION USING PARAM-LIST
RETURNING PARAM-OUT-DATA.

However, when I use the new function with
SELECT CNGETADR(1)
FROM SYSIBM.SYSDUMMY1;
I get
SQLCODE = -450, ERROR: USER-DEFINED FUNCTION OR STORED PROCEDURE
CNGETADR, PARAMETER NUMBER 1, OVERLAYED STORAGE BEYOND ITS DECLARED
LENGTH
SQLSTATE = 39501 SQLSTATE RETURN CODE

Can anybody tell me what I did wrong?

TIA
Sep 1 '06 #1
0 3414

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

Similar topics

11
by: Savas Ates | last post by:
CREATE PROCEDURE st_deneme @userid numeric (18) ,@result numeric (18) output AS select * from users return "10" GO **************************** <!--METADATA TYPE="typelib" NAME="Microsoft...
7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
1
by: Station Media | last post by:
Hi, here my problem, i use stored procedure in ACCESS database(latest version), and i would like to use this procedure but it doesnt work, do you know why ? Procedure: PARAMETERS MyField Text...
1
by: Hugo Flores | last post by:
Hello I have this code in actionscript that calls javascript: actionscript: zoom_in = function () { var tw1:Tween = new Tween(mc_1, "_width", Regular.easeOut, mc_1._width, 0, 1, false);...
0
by: bog39 | last post by:
We have z/os and DB/2 V. 8 running. I try to create a new UDF using the command CREATE FUNCTION: CREATE FUNCTION CNGETADR (INTEGER) RETURNS CHAR(50) EXTERNAL NAME CNADR001 PARAMETER STYLE DB2SQL...
2
by: effendi | last post by:
Hi I tested the following function in Safari and it doesnt work. This is tested fine in IE. function processOutcome(){ mainDatabase=document.forms.AssessDatabase.value var...
0
by: Juna | last post by:
I have been working in vs2003, but now started to work in vs2005 but the problem, I have simple web application not website, which work i mean open in browser when we press F5 or run the...
2
Thew
by: Thew | last post by:
<script language="javascript" type="text/javascript"> function spoilershow(){ document.getElementById("spoiler").style.visibility='visible'; document.getElementById("show").value='close';...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.