× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Simon Coulter skrev den 30-08-2008 00:12:
I don't know why without seeing the SQL statement and the COBOL code but I do know what so maybe that will help:

Ok, here is the SQL statement

===

CREATE PROCEDURE TRATEST.ADD2NUM (
IN A NUMERIC(5, 0) ,
IN B NUMERIC(5, 0) ,
OUT C NUMERIC(5, 0) ,
OUT D NUMERIC(5, 0) )
LANGUAGE COBOL
SPECIFIC TRATEST."add2num OPM"
NOT DETERMINISTIC
NO SQL
CALLED ON NULL INPUT
EXTERNAL NAME 'TRATEST/ADD2NUM'
PARAMETER STYLE GENERAL ;

COMMENT ON SPECIFIC PROCEDURE TRATEST."add2num OPM"
IS 'test jdbc-opm programcall' ;

===

and here is the Cobol code (I use WSDCi 7.0 to call the compiler):

===
IDENTIFICATION DIVISION.

PROGRAM-ID. ADD2NUM.
AUTHOR. TRA.
DATE-WRITTEN. AUG 2008.

ENVIRONMENT DIVISION.

DATA DIVISION.

WORKING-STORAGE SECTION.

LINKAGE SECTION.

01 A PIC 9(5).
01 B PIC 9(5).
01 C PIC 9(5).
01 D PIC 9(5).

PROCEDURE DIVISION USING A, B, C, D.

MAIN SECTION.

MAIN-BEGIN.

COMPUTE C = A + B.
COMPUTE D = A * B.

MAIN-EXIT.
STOP RUN.
===

and the full text retreived with "D" in the inquery message (just for completeness):

===
MCH1202 exception in program ADD2NUM in TRATEST at MI instruction number 0035 COBOL statement number 14. FORMATTED DATA DUMP FOR PROGRAM ADD2NUM.TRATEST 11:16:12 01.09.08 NAME OFFSET ATTRIBUTES VALUE
A 009120 ZONED(5,0)
**INVALID DATA '4EF0F0F0F0'X
B 009126 ZONED(5,0)
**INVALID DATA '4EF0F0F0F2'X
C 00912C ZONED(5,0)
**INVALID DATA '4EF0F0F0F0'X
D 009132 ZONED(5,0)
**INVALID DATA '4EF0F0F0F0'X
STATIC STORAGE FOR PROGRAM ADD2NUM.TRATEST BEGINS AT OFFSET 072240 IN THE PROGRAM STATIC STORAGE AREA (PSSA) AUTOMATIC STORAGE FOR PROGRAM ADD2NUM.TRATEST BEGINS AT OFFSET 000080 IN THE PROGRAM AUTOMATIC STORAGE AREA (PASA) ===

As mentioned I need to get the PIC(5) mask to work properly. If I cannot get rid of the sign, I can live with only being able to stuff a sign + four digits in the area if I can get the result properly back from C and D :)

I'd still appreciate any hints or suggestions :)


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.