Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
multi-row fetch : Confused in FOR nn ROWS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Tue Nov 18, 2008 6:35 pm    Post subject: multi-row fetch : Confused in FOR nn ROWS
Reply with quote

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
View user's profile Send private message

Cristopher

New User


Joined: 31 Jul 2008
Posts: 53
Location: NY

PostPosted: Tue Nov 18, 2008 7:48 pm    Post subject: Reply to: multi-row fetch : Confused in FOR nn ROWS
Reply with quote

Hi,
Can you try s9(9) usage comp as picture clause for the LOOP variable.

Cris
Back to top
View user's profile Send private message
Bharath Bhat

Active User


Joined: 20 Mar 2008
Posts: 283
Location: chennai

PostPosted: Tue Nov 18, 2008 7:53 pm    Post subject:
Reply with quote

Probably this could support Cris.
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1013
Location: India

PostPosted: Tue Nov 18, 2008 7:56 pm    Post subject:
Reply with quote

Thank You Cristopher, It works
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. How to acheive Multi thread parallel ... pkmurali Compuware & Other Tools 1 Sun Mar 25, 2018 10:46 am
No new posts help to replace columns by rows Vikas Maharnawar DFSORT/ICETOOL 8 Tue Mar 06, 2018 3:27 pm
No new posts Logic to skip Maximum time-stamp and ... vickey_dw DB2 2 Thu Feb 01, 2018 11:15 pm
No new posts Query to skip Max time-stamp and fetc... vickey_dw DB2 8 Sun Jan 28, 2018 1:09 am
No new posts query to fetch record which has only ... maxsubrat DB2 12 Mon Dec 11, 2017 5:03 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us