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: 6966
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: 6966
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: 1278
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 OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm
No new posts Invoke Webservice Fails with DFHPI100... divated CICS 2 Thu Nov 24, 2016 5:57 pm
No new posts Error during restore rename archanamuthukrishnan All Other Mainframe Topics 2 Fri Oct 14, 2016 3:30 pm
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm


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