View previous topic :: View next topic
|
Author |
Message |
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Hi,
I am writing a COBOL-DB2 program using multi-row fetch. This is the fetch code
Code: |
EXEC SQL
FETCH NEXT ROWSET FROM ECURSOR FOR :LOOP ROWS
INTO :WS-EMPNO :WS-INDI ,:WS-FIRSTNME
END-EXEC |
Input for the FOR nn rows, it can be either a numeric value or a host variable. That is what i read in this article.
I am getting an error, when a host variable is used, in this place.
Code: |
UNDEFINED OR UNUSABLE HOST VARIABLE "LOOP"
HOST VARIABLE "LOOP" IS NOT EXACT NUMERIC WITH SCALE ZERO |
This is the declaration of the LOOP variable.
Code: |
01 LOOP PIC 9(3) VALUE 10. |
Can you tell me, where, i am making the MISTAKE.
Thank You,
Sushanth |
|
Back to top |
|
|
Cristopher
New User
Joined: 31 Jul 2008 Posts: 53 Location: NY
|
|
|
|
Hi,
Can you try s9(9) usage comp as picture clause for the LOOP variable.
Cris |
|
Back to top |
|
|
Bharath Bhat
Active User
Joined: 20 Mar 2008 Posts: 283 Location: chennai
|
|
|
|
Probably this could support Cris. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Thank You Cristopher, It works |
|
Back to top |
|
|
|