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: 788
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts DB2 9.1.0 not move values to Host-Var... Miguel Fernandez DB2 8 Wed Jan 25, 2017 8:24 pm


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