IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Varchar host variable with occurs clause in multirow ?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vyasricha

New User


Joined: 17 Mar 2008
Posts: 27
Location: banaglore

PostPosted: Tue Apr 10, 2012 6:40 pm
Reply with quote

Hi ,
Can we use varchar host variable with occurs clause in multi row concept ? I am using a varchar variable during a fetch cursor ,

Code:
Defination of variable :
01 WS-variable 
   10 Ws-NAME                                PIC  x(10) OCCURS 10 TIMES.
   10 WS-CLASS  OCCURS 10 TIMES.
   49 Ws-CLASS-NAME-LEN    PIC S9(4) USAGE COMP.                 
   49 Ws-CLASS-TEXT           PIC X(35).                           

Fetch cursor :
EXEC-SQL
FETCH NEXT ROWSET         
FROM  NEW-CLASS FOR 10 ROWS
INTO  :WS-NAME
       , :WS-CLASS
END-EXEC

Its working fine for WS-NAME but for WS-CLASS it is giving error that ws-class not defined or unused ?

Code:
DSN5011I AE     DSNHSMUD LINE 1789 COL 25  HOST VARIABLE ARRAY "WS-CLASS" IS EITHER NOT DEFINED OR IS NOT USABLE.

Please suggest !
Back to top
View user's profile Send private message
Gnanas N

Active Member


Joined: 06 Sep 2007
Posts: 792
Location: Chennai, India

PostPosted: Tue Apr 10, 2012 7:02 pm
Reply with quote

Try adding SYNC clause to "Ws-CLASS-NAME-LEN"
Back to top
View user's profile Send private message
Naish

New User


Joined: 07 Dec 2006
Posts: 82
Location: UK

PostPosted: Tue Apr 10, 2012 7:17 pm
Reply with quote

This might be of help.

www.ibmmainframes.com/about44452.html
Back to top
View user's profile Send private message
View previous topic : : View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Converting VARCHAR to XML DB2 1
No new posts variable in library name within a PROC. JCL & VSAM 11
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts CA7 count with DATE variable CA Products 0
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:


Back to Top