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
 

 

Cobol Search Error

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
syed-sameer-ahmed
Warnings : 2

New User


Joined: 22 Feb 2007
Posts: 46
Location: Bangalore

PostPosted: Tue Nov 27, 2007 12:25 pm    Post subject: Cobol Search Error
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

Site Director


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

PostPosted: Tue Nov 27, 2007 12:37 pm    Post subject:
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    Post subject:
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: 130
Location: Guntur

PostPosted: Tue Nov 27, 2007 2:52 pm    Post subject:
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    Post subject: Reply to: Cobol Search Error
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: 46
Location: Bangalore

PostPosted: Tue Nov 27, 2007 7:29 pm    Post subject:
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

Site Director


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

PostPosted: Tue Nov 27, 2007 8:55 pm    Post subject: Reply to: Cobol Search Error
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    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
This topic is locked: you cannot edit posts or make replies. Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm


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