View previous topic :: View next topic
|
Author |
Message |
sunny_io
New User
Joined: 11 Jul 2007 Posts: 68 Location: noida
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
Back to top |
|
|
Raghu navaikulam
Active User
Joined: 27 Sep 2008 Posts: 193 Location: chennai
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
GuyC
Senior Member
Joined: 11 Aug 2009 Posts: 1281 Location: Belgium
|
|
|
|
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 |
|
Back to top |
|
|
sunny_io
New User
Joined: 11 Jul 2007 Posts: 68 Location: noida
|
|
|
|
Hello All.
Its compiling now with occurs placed at 05 level instead of 49.
Thanks for your inputs |
|
Back to top |
|
|
|