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 a COMP-3 Variable to a Numeric... ajayachander COBOL Programming 2 Thu Dec 14, 2017 5:46 pm
No new posts Date in where clause - Windows Karthikeyan Subbarayan DB2 9 Wed Nov 15, 2017 9:07 pm
No new posts Move from Comp3 variable to Edited Va... Revathy.nair0485 COBOL Programming 7 Fri Nov 03, 2017 3:30 pm
This topic is locked: you cannot edit posts or make replies. Can a alphanumeric data be moved to a... nico_neoz COBOL Programming 10 Mon Oct 30, 2017 8:28 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm

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