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 II Error: NOT A UNIQUELY DEFINED NAME

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
MANUEL LEMA
Currently Banned

New User


Joined: 23 Sep 2007
Posts: 9
Location: NY

PostPosted: Tue Sep 25, 2007 4:59 am    Post subject: Cobol II Error: NOT A UNIQUELY DEFINED NAME
Reply with quote

Hi! i am writing a tax program but i keep getting this error could someone help me please.....

"SALE-AMOUNT" WAS NOT A UNIQUELY DEFINED NAME. THE DEFINITION TO BE USED CONTEXT. THE REFERENCE TO THE NAME WAS DISCARDED.
Back to top
View user's profile Send private message

CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Sep 25, 2007 5:25 am    Post subject:
Reply with quote

Use a higher level reference?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Sep 25, 2007 6:14 am    Post subject: Re: Cobol II Error: NOT A UNIQUELY DEFINED NAME
Reply with quote

MANUEL LEMA wrote:
Hi! i am writing a tax program but i keep getting this error could someone help me please.....

"SALE-AMOUNT" WAS NOT A UNIQUELY DEFINED NAME. THE DEFINITION TO BE USED CONTEXT. THE REFERENCE TO THE NAME WAS DISCARDED.
You just need to change SALE-AMOUNT in one of the places that you define it or qualify the name when you use it.
Back to top
View user's profile Send private message
kbmkris

Active User


Joined: 24 Jun 2006
Posts: 101

PostPosted: Tue Sep 25, 2007 6:25 am    Post subject:
Reply with quote

hi Lema,

Check whether the variable SALE-AMOUNT is defined twice in your source code. If it is coded and you felt that necessary, try to put them under different group variables and while accessing that you must mention the group variable like SALE-AMOUNT of TAX-REC1 likewise.
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 130
Location: Guntur

PostPosted: Wed Sep 26, 2007 1:02 pm    Post subject:
Reply with quote

Hi Lema,

I think that might be coming because of the copybook variables.

you might have declared a variable that is used in copybook.

So at compile time you will get this message.

Check in the dump where it is showing the duplicate,there you will have your copybook expanded.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Sep 26, 2007 2:20 pm    Post subject:
Reply with quote

Hi MANUEL LEMA,

If you post the the definition of "SALE-AMOUNT", it'll be easier for me or some one here to answer your query.

Variable "SALE-AMOUNT" is from FD entries or declared in working-storage or from some COPYBOOK ?
Back to top
View user's profile Send private message
MANUEL LEMA
Currently Banned

New User


Joined: 23 Sep 2007
Posts: 9
Location: NY

PostPosted: Thu Sep 27, 2007 12:34 am    Post subject:
Reply with quote

Anuj D. wrote:
Hi MANUEL LEMA,

If you post the the definition of "SALE-AMOUNT", it'll be easier for me or some one here to answer your query.

Variable "SALE-AMOUNT" is from FD entries or declared in working-storage or from some COPYBOOK ?


well it is declared in the working -storage section under
01 sales record w
05 sale-amount pic 9(4)v99.
then in the detail line
01 detail-line.
05 sale-amount pic zz,zz9.99
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Thu Sep 27, 2007 12:46 am    Post subject:
Reply with quote

When referring to one or the other use the next available unique higher level data name:
Move sale-amount of sales-record to sale-amount of detail-line.

Do you need a link to the explanative section in the manual?
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Sep 27, 2007 12:48 am    Post subject:
Reply with quote

MANUEL LEMA wrote:
well it is declared in the working -storage section under
01 sales record w
05 sale-amount pic 9(4)v99.
then in the detail line
01 detail-line.
05 sale-amount pic zz,zz9.99


How is the COBOL compiler suppose to know which sale-amount you are refering to when you use that dataname.
Back to top
View user's profile Send private message
ksk

Active User


Joined: 08 Jun 2006
Posts: 356
Location: New York

PostPosted: Thu Sep 27, 2007 10:29 am    Post subject:
Reply with quote

Hi MANUEL LEMA,

You have to use QUALIFIER concept to differentiate this SALES-AMOUNT to which it is referring.

If you want to use sale-amount which is part of sales-record, use it as

SALE-AMOUNT of SALES-RECORD or

if you want to use sale-amount which is part of deatil-line, use it as

SALE-AMOUNT of DETAIL-LINE.

Regards,
KSK
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Sep 27, 2007 2:47 pm    Post subject:
Reply with quote

Hi,

Did you get the solution for your query or still some confusion is there ?
If got the solution, please post that here; if not, we are here for further queris.
Back to top
View user's profile Send private message
MANUEL LEMA
Currently Banned

New User


Joined: 23 Sep 2007
Posts: 9
Location: NY

PostPosted: Thu Sep 27, 2007 6:26 pm    Post subject:
Reply with quote

[quote="Anuj D."]Hi,

Did you get the solution for your query or still some confusion is there ?
If got the solution, please post that here; if not, we are here for further queris.[/quot

i got the solution thanks to everyone....
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Sep 27, 2007 6:54 pm    Post subject:
Reply with quote

You are welcome MANUEL icon_smile.gif ,

In my previous post, I requested you to post the solution as well.
Quote:
If got the solution, please post that here


If you do so, it might help to some other member of the forum in future.
Back to top
View user's profile Send private message
MANUEL LEMA
Currently Banned

New User


Joined: 23 Sep 2007
Posts: 9
Location: NY

PostPosted: Thu Sep 27, 2007 7:07 pm    Post subject:
Reply with quote

Anuj D. wrote:
You are welcome MANUEL icon_smile.gif ,

In my previous post, I requested you to post the solution as well.
Quote:
If got the solution, please post that here
The solution is:
compute sales-taxes of sales-record-w * .08.
i just needed to specify wich sales-taxes i am refering to because i have sales-taxes in my program.

If you do so, it might help to some other member of the forum in future.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Oct 01, 2007 6:10 pm    Post subject:
Reply with quote

Thanks for posting the solution. icon_smile.gif

So you use the solution as suggested by ksk:At different 'locations' in program you use the statements for SALE-AMOUNT like
Code:
SALE-AMOUNT of DETAIL-LINE.


to make the COMPLIER to distinguish between the same element level variable-name (SALE-AMOUNT) under different group-level variables, right ? Please confirm.
Back to top
View user's profile Send private message
MANUEL LEMA
Currently Banned

New User


Joined: 23 Sep 2007
Posts: 9
Location: NY

PostPosted: Tue Oct 02, 2007 1:27 am    Post subject:
Reply with quote

Anuj D. wrote:
Thanks for posting the solution. icon_smile.gif

So you use the solution as suggested by ksk:At different 'locations' in program you use the statements for SALE-AMOUNT like
Code:
SALE-AMOUNT of DETAIL-LINE.


to make the COMPLIER to distinguish between the same element level variable-name (SALE-AMOUNT) under different group-level variables, right ? Please confirm.

YES THAT'S EXACTLY WHAT I DID
Back to top
View user's profile Send private message
dr_te_z

New User


Joined: 08 Jun 2007
Posts: 71
Location: Zoetermeer, the Netherlands

PostPosted: Tue Oct 02, 2007 3:27 pm    Post subject:
Reply with quote

Let me confuse you some more:
in COBOL
Code:
SALE-AMOUNT OF DETAIL-LINE
and
Code:
 
SALE-AMOUNT IN DETAIL-LINE
notations are both allowed and correct.
The
Code:
:DETAIL-LINE.SALE-AMOUNT
notation is only used in embedded SQL
Back to top
View user's profile Send private message
MANUEL LEMA
Currently Banned

New User


Joined: 23 Sep 2007
Posts: 9
Location: NY

PostPosted: Tue Oct 02, 2007 6:26 pm    Post subject:
Reply with quote

dr_te_z wrote:
Let me confuse you some more:
in COBOL
Code:
SALE-AMOUNT OF DETAIL-LINE
and
Code:
 
SALE-AMOUNT IN DETAIL-LINE
notations are both allowed and correct.
The
Code:
:DETAIL-LINE.SALE-AMOUNT
notaion is only used in embedded SQL

Really well i supposed that but i didn't try it and it's not confunsing...i love challenges.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Oct 02, 2007 8:19 pm    Post subject:
Reply with quote

I usually code all 05 or higher numbered level variables with the beginning chars of the 01 level name to avoid your problem. Eg.:
Code:

01 sales-record.
05 sr-sale-amount pic 9(4)v99.

01 detail-line.
05 dl-sale-amount pic zz,zz9.99.
Back to top
View user's profile Send private message
MANUEL LEMA
Currently Banned

New User


Joined: 23 Sep 2007
Posts: 9
Location: NY

PostPosted: Tue Oct 02, 2007 9:01 pm    Post subject:
Reply with quote

mmwife wrote:
I usually code all 05 or higher numbered level variables with the beginning chars of the 01 level name to avoid your problem. Eg.:
Code:

01 sales-record.
05 sr-sale-amount pic 9(4)v99.

01 detail-line.
05 dl-sale-amount pic zz,zz9.99.


yea i think that's what ill have to do from now on thanks for helping.
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 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
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am


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