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

Compilation error !!NOT DEFINED OR IS NOT IS NOT USABLE.. !!


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sunny_io

New User


Joined: 11 Jul 2007
Posts: 68
Location: noida

PostPosted: Thu Oct 15, 2009 11:49 am
Reply with quote

Hello
This is how my variables are defined and used...

05 AAAAA.
49 CCCCC-Length PIC S9(04) COMP
OCCURS 100 TIMES.
49 CCCCC PIC X(342)
OCCURS 100 TIMES.
..
..
05 T-AAAAA.
49 T-CCCCC-Length PIC S9(04) COMP.
49 T-CCCCC PIC X(342).
..
..
01 Index PIC S9(4) COMP
VALUE +1.
..
..
IF CCCCC-Length(Index) < 0
MOVE 0 TO CCCCC-Length (Index)
END-IF

Move CCCCC (Index) to T-CCCCC

..

This code is giving me compilation error.
HOST VARIABLE ARRAY "AAAAA" IS EITHER NOT DEFINED OR IS NOT IS NOT USABLE..

Can some one pls explain why ?
TIA
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Oct 15, 2009 12:26 pm
Reply with quote

refer to IBM Redbook DB2 UDB for z/OS Version 8: Everything You Ever Wanted to Know, ... and More,
4.5.5 Host variable arrays at the bottom of page.
Back to top
View user's profile Send private message
Raghu navaikulam

Active User


Joined: 27 Sep 2008
Posts: 193
Location: chennai

PostPosted: Thu Oct 15, 2009 12:29 pm
Reply with quote

Hi

Is the variable definition 'AAAAA' starts with 05 level? If so it will give error. A variable definition should starts with 01 or 77 level only. In your case it must starts with 01.

Change it to 01 level and compile it.
Hope this will help you

Regards
Raghu
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Oct 15, 2009 12:41 pm
Reply with quote

Raghu navaikulam wrote:
Hi

Is the variable definition 'AAAAA' starts with 05 level? If so it will give error. A variable definition should starts with 01 or 77 level only. In your case it must starts with 01.

Change it to 01 level and compile it.
Hope this will help you

Regards
Raghu


Raghu,

read the link in my post.
Maybe then you will see your post is not accurate.

Guyc, I tried not to be aggressive.
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Wed Oct 21, 2009 4:11 pm
Reply with quote

When you get an error "host variable not usable", it is very likely that there is a SQL statement involved somewhere . I see no sql statement in the first post.

If you read the redbook you would see that for varchars used in a multiple row-fetch, the "occurs" should be on the 05 level and not on 49 level.

As dbz i shall refrain from using !! or caps icon_wink.gif
Back to top
View user's profile Send private message
sunny_io

New User


Joined: 11 Jul 2007
Posts: 68
Location: noida

PostPosted: Wed Oct 21, 2009 4:32 pm
Reply with quote

Hello All.
Its compiling now with occurs placed at 05 level instead of 49.
Thanks for your inputs
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Getting Error while trying to establi... DB2 3
Search our Forums:

Back to Top