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 Usergroups Profile Log in to check your private messages Log in
 

 

Varchar host variable with occurs clause in multirow ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Varchar host variable with occurs clause in multirow ?
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: 785
Location: Chennai, India

PostPosted: Tue Apr 10, 2012 7:02 pm    Post subject:
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    Post subject:
Reply with quote

This might be of help.

http://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    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
No new posts Low values Results from VARCHAR FORMAT balaji81_k DB2 10 Thu Oct 20, 2016 1:18 am
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts Need help on SQL Dynamic WHERE Clause subratarec DB2 12 Sat Jul 16, 2016 3:11 pm
No new posts OPC JCL Variable passion_sujesh IBM Tools 5 Fri Jul 01, 2016 4:21 am


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