473,474 Members | 1,571 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

CREATE FUNCTION with COBOL doesn't work!!

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/infoce...d/r0009191.htm
and
ftp://ftp.software.ibm.com/ps/produc...S/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?

Sep 1 '06 #1
0 1321

This thread has been closed and replies have been disabled. Please start a new discussion.

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 ...
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...
3
by: jx2 | last post by:
hi guys i would appriciate your coments on this code - when i ran it for the very first time it doesnt see @last = LAST_INSERT_ID() but when i ran it next time it read it properly i need to know it...
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';...
0
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...
0
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...
1
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...
0
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...
1
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...
0
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...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.