Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
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
 
How to use host variable in Cursor??

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
muhammad

New User


Joined: 25 Oct 2007
Posts: 19
Location: hyderabad

PostPosted: Mon Mar 03, 2008 8:26 pm    Post subject: How to use host variable in Cursor??
Reply with quote

DECLARE CONTACT-CSR CURSOR FOR
SELECT X.CONTACT_FIRST_NM,
X.CONTACT_LAST_NM,
X.CONTACT_EMAIL_ADDR
FROM CONTACT_TABLE X
WHERE X.REF_NUM = : WS-TEMP-NUM

i declared the above cursor in Working Storage section...

I want to move some value in WS-TEMP-NUM and then fetch the cursor...

Its giving compilation error that WS-TEMP-NUM is not a valid host variable.. need help pls...
Back to top
View user's profile Send private message

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Mar 03, 2008 8:29 pm    Post subject: Re: How to use host variable in Cursor??
Reply with quote

muhammad wrote:
DECLARE CONTACT-CSR CURSOR FOR
SELECT X.CONTACT_FIRST_NM,
X.CONTACT_LAST_NM,
X.CONTACT_EMAIL_ADDR
FROM CONTACT_TABLE X
WHERE X.REF_NUM = : WS-TEMP-NUM

i declared the above cursor in Working Storage section...

I want to move some value in WS-TEMP-NUM and then fetch the cursor...

Its giving compilation error that WS-TEMP-NUM is not a valid host variable.. need help pls...


Is ws-temp-num defined? What are the definitions of X.REF_NUM and WS-TEMP-NUM?
Back to top
View user's profile Send private message
muhammad

New User


Joined: 25 Oct 2007
Posts: 19
Location: hyderabad

PostPosted: Mon Mar 03, 2008 8:35 pm    Post subject:
Reply with quote

yeah.. it is defined...

05 WS-REF-NUM-DIV PIC 9(07)

and in the table, REF_NUM is Decimal(7,0) !!!!
Back to top
View user's profile Send private message
muhammad

New User


Joined: 25 Oct 2007
Posts: 19
Location: hyderabad

PostPosted: Mon Mar 03, 2008 8:36 pm    Post subject:
Reply with quote

yeah.. it is defined...

05 WS-TEMP-NUM PIC 9(07)

and in the table, REF_NUM is Decimal(7,0) !!!!
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Mar 03, 2008 8:40 pm    Post subject:
Reply with quote

muhammad wrote:
yeah.. it is defined...

05 WS-TEMP-NUM PIC 9(07)

and in the table, REF_NUM is Decimal(7,0) !!!!


DB2 doesn't use unsigned numbers and the cobol equivalent of decimal is COMP-3, try this.
05 WS-TEMP-NUM PIC S9(7) COMP-3.
Back to top
View user's profile Send private message
muhammad

New User


Joined: 25 Oct 2007
Posts: 19
Location: hyderabad

PostPosted: Mon Mar 03, 2008 9:44 pm    Post subject:
Reply with quote

k.. now iam getting SQL -805
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Mon Mar 03, 2008 10:02 pm    Post subject:
Reply with quote

Look it up in the manual. It is at the top of page 'IBM MANUALS".
Back to top
View user's profile Send private message
star_dhruv2000

New User


Joined: 03 Nov 2006
Posts: 87
Location: Plymouth, MN USA

PostPosted: Tue Mar 04, 2008 6:01 pm    Post subject:
Reply with quote

-805 I think is program name not found in plan .. You need to properly BIND your program ...

Cheers icon_smile.gif
Back to top
View user's profile Send private message
acevedo

Active User


Joined: 11 May 2005
Posts: 344
Location: Spain

PostPosted: Tue Mar 04, 2008 6:04 pm    Post subject:
Reply with quote

DBRM OR PACKAGE NAME NOT FOUND IN PLAN.
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Testing rerad cursor for status with ... John F Dutcher DB2 8 Fri May 19, 2017 9:35 pm

Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us