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

Cobol Search Error


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
syed-sameer-ahmed
Warnings : 2

New User


Joined: 22 Feb 2007
Posts: 45
Location: Bangalore

PostPosted: Tue Nov 27, 2007 12:25 pm
Reply with quote

Hi,

I have a cobol where i have defined the index variable.
buti am getting the error as

"VAR" was not a uniquely defined name. The definition to be used could not be determined from the context.The reference to the name was discarded.



the code is:

SEARCH WS-abc-VALUES
AT END DISPLAY 'UNABLE TO MOVE'
WHEN WS-xyz-ID(VAR) = WS-HOLD-xyz-CODE


but VAR is uniquely defined code..
my req is to pull the values from VSAM file and store it in a WS-TAble.

and search this table and move the corresponding values to it..

I really not getting what exactly is the error..

IF you have any other ideas too..its welcome..

Thanks!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Nov 27, 2007 12:37 pm
Reply with quote

Hello,

Please post the array and the VAR variable.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Nov 27, 2007 1:10 pm
Reply with quote

won't it be nice when people stop insisting the compiler made an error?

You could always check the xref from the compiler listing and see what 'stupid error the compiler has made'.
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 128
Location: Guntur

PostPosted: Tue Nov 27, 2007 2:52 pm
Reply with quote

Hi Sameer,

Please post your code, Use the code tag to post it.
Back to top
View user's profile Send private message
ramesh_ibm

New User


Joined: 17 Nov 2007
Posts: 16
Location: banglore

PostPosted: Tue Nov 27, 2007 6:09 pm
Reply with quote

i think you have explicitly defined VAR.

since u r using search, VAR must be an index variable and should occur only once in table definition like
Code:
occurs 10 r times indexed by var

and should not be defined with PIC clause

I am sorry if that is not ur problem or my understanding is not proper..

if u paste ur code will try to help
Back to top
View user's profile Send private message
syed-sameer-ahmed
Warnings : 2

New User


Joined: 22 Feb 2007
Posts: 45
Location: Bangalore

PostPosted: Tue Nov 27, 2007 7:29 pm
Reply with quote

Hi people,
I am sorry for the reply..The VAR error is solved..

I had defined VAR as Usage is index at 88 level,which gave rise to error..

Thanks...
I came to know the various of creating a error in program.

Thanks again.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Nov 27, 2007 8:55 pm
Reply with quote

Thank you for posting the problem and solution icon_smile.gif

d
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 Replace each space in cobol string wi... COBOL Programming 2
No new posts Error to read log with rexx CLIST & REXX 11
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Error when install DB2 DB2 2
No new posts Search two or more word with FILEAID Compuware & Other Tools 15
Search our Forums:

Back to Top