Page 1 of 1

Name is undefined

PostPosted: Tue Jul 27, 2010 1:44 am
by nicole
Hi there,

I do not understand the error I am getting in my easytrieve program. I am quite sure I have declared the name but still getting this same error:

WS1-LABEL(WS1-SUPP-HST-BC-POS) = 'HST - HST-BC'
**B082 NAME IS UNDEFINED - WS1-SUPP-HST-BC-POS

AND THIS ERROR:

*******B260 LITERAL LENGTH MUST BE EQUAL TO FIELD LENGTH - HST-MOB-BC
WS1-TEMP-INDEX = WS1-SUPP-HST-MOB-BC-POS

Any help please.

Re: Name is undefined

PostPosted: Tue Jul 27, 2010 1:47 am
by dick scherrer
Hello,

If Easytrieve says there is something wrong, i tend to believe it. . .

For us to help, you need to provide the problem code/variables not just the error messages.

I am quite sure I have declared the name but still getting this same error:
Post the code just before this thru just after (only a few lines).

There is no literal shown in the posted info :?

Re: Name is undefined

PostPosted: Tue Jul 27, 2010 2:43 am
by nicole
Ok before I post anything more, what exactly is a literal.

Re: Name is undefined

PostPosted: Tue Jul 27, 2010 3:04 am
by dick scherrer
Hello,

Something that is not variable. . .

In COBOL:
IF FIELD-A = 'RREETTYY'

RREETTYY is a literal.

Re: Name is undefined

PostPosted: Tue Jul 27, 2010 3:12 am
by nicole
This was what I defined in my report variables:

WS1-SUPP-HST-BC-POS W 02 N VALUE 28

Initaialize Table:

WS1-LABEL(WS1-SUPP-HST-BC-POS)= 'HST - HST-BC'

Process .proc:

WHEN 'HST-BC'
WS1-TEMP-INDEX = WS1-SUPP-HST-BC-POS

Ok I hope this helps..thanks.

Re: Name is undefined

PostPosted: Tue Jul 27, 2010 9:10 am
by dick scherrer
Hello,

You have chosen to only post a tiny bit of the problem code. . . And did not include the the source with the errors Easytrieve detected.

You need to post the definitions of all of the referenced fields and the code surrounding any line that causes an error along with the complete error line(s).

Re: Name is undefined

PostPosted: Tue Jul 27, 2010 7:56 pm
by nicole
Hi Mr. Scherrer, Hope this is the rest you need to help me.

2427           WHEN 'SSC       '                                       
2428             CASE SRC-ID-71                                       
2429                WHEN 'SASKMOBILE '                                 
2430                     WS1-TEMP-INDEX = WS1-SUPP-ONE-POS             
2431                WHEN 'HST     '                                   
2431 *******B260 LITERAL LENGTH MUST BE EQUAL TO FIELD LENGTH - HST   
2432                     WS1-TEMP-INDEX = WS1-SUPP-HST-POS


2441                 WHEN 'HST-MOB     '                               
2441 *******B260 LITERAL LENGTH MUST BE EQUAL TO FIELD LENGTH - HST-MOB
2442                      WS1-TEMP-INDEX = WS1-SUPP-HST-MOB-POS

Re: Name is undefined

PostPosted: Wed Jul 28, 2010 3:10 am
by dick scherrer
Hello,

Hope this is the rest you need to help me
Unfortunately, it is not. . .

To repeat:
You need to post the definitions of all of the referenced fields
I do not see the definition of the fields referenced in the code.

The B260 is caused by the length of the literals in those statements - they all need to be the same length as the data field. The first literal appears to be correct, but for some reason the others are different lengths. . .

How many times is the "name is undefined" error shown? How many times is this field referenced in the code?

Re: Name is undefined

PostPosted: Wed Jul 28, 2010 8:58 pm
by nicole
Hey D.S.

Ok I figured it out and sorry again I didn't post enough info. but I'll eventually get the hang of it. So here is where I went wrong:

WHEN 'HST ' <--- I did not have the proper amount of spaces.
WS1-TEMP-INDEX = WS1-SUPP-OTH-POS

Now I understand, sorry if I wasted your time, but thanks again. Have a great day. Nicole

Re: Name is undefined

PostPosted: Thu Jul 29, 2010 12:34 am
by dick scherrer
Hi Nicole,

You're welcome

Now I understand, sorry if I wasted your time, but thanks again.
No, not wasted. We're here to help when things don't "click". One of the things that will be invaluable is developing a way to get most of the needed information "in play" on the first post. It really doesn't cost us so much to ask for more info, but it slows your getting a solution ;)

This is true if the question is posted on a forum or to some vendor support.

Good luck and someone will be here when there are other questions,

d