Gianni,
Thanks for the response.
The database, tables and stored procedures are on the same sql server 2000. I'm using Fujitsu Cobol V6.1, the enterprise version which does have power cobol with it but I need to eventually wrap this cobol with object oriented code so that is why I'm not using the PowerCobol. With the Fujitsu Cobol 6.1 I did not see a utility called DbAccess control but I will do some more searching. For now what I wanted to show you is a part from the source code working storage, procedure section and then the stored procedure on the sql server that is being called. I know the stored procedure works because I use it in an asp web page that was designed using Front Page and it returns all the rows. I think my stumpling block here is how do I use or get the data rows that are being returned back in to the cobol program?
*** WORKING STORAGE
EXEC SQL BEGIN DECLARE SECTION END-EXEC.
01 TAX-YEAR PIC S9(04).
01 COLLECTOR-NUMBER PIC S9(10).
01 MSG PIC X(255).
01 DESCRIPTION PIC X(30).
01 EXEMPT-AMOUNT PIC 9(11)V9(2).
01 SQLSTATE PIC X(5) VALUE SPACES.
01 SQLCODE PIC S9(9) COMP-5 VALUE 0.
01 SQLMSG PIC X(128) VALUE SPACES.
EXEC SQL END DECLARE SECTION END-EXEC.
*** PROCEDURE DIVISION
PROCEDURE DIVISION.
0000-BALANCING-REPORTS.
EXEC SQL
CONNECT TO DEFAULT
END-EXEC.
EXEC SQL
EXECUTE REEXEMPTIONS( :TAX-YEAR,
:COLLECTOR-NUMBER,
:MSG)
END-EXEC.
*** STORED PROCEDURE
CREATE PROCEDURE reExemptions
@tax_year int,
@collector_number numeric(10,0),
@msg varchar(255) = '' output
AS
SELECT exemption_code.exempt_code description,
exempt_amount
FROM exemption_code,
exemption_value
WHERE exemption_code.exempt_code = exemption_value.exempt_code and
collector_number = @collector_number AND
tax_year = @tax_year
GO