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
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Compilation error !!NOT DEFINED OR IS NOT IS NOT USABLE.. !!
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: 6967
Location: porcelain throne

PostPosted: Thu Oct 15, 2009 12:26 pm    Post subject:
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: 186
Location: chennai

PostPosted: Thu Oct 15, 2009 12:29 pm    Post subject: Reply to: Compilation error !!NOT DEFINED OR IS NOT IS NOT U
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: 6967
Location: porcelain throne

PostPosted: Thu Oct 15, 2009 12:41 pm    Post subject: Re: Reply to: Compilation error !!NOT DEFINED OR IS NOT IS N
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    Post subject:
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    Post subject: The peobs solved. Thanks guys
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am
No new posts Need help with below DB2 error ashek15 DB2 3 Sat Mar 18, 2017 5:56 am
No new posts FINDREP Syntax Error seahawk789 DFSORT/ICETOOL 4 Thu Mar 09, 2017 10:11 pm
No new posts INVOKE WEBSERVICE error danik56 CICS 11 Thu Mar 09, 2017 11:52 am


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