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
 
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 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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm

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