View previous topic :: View next topic
|
Author |
Message |
murugan_mf
Active User
Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
|
|
|
|
Hi, Could someone help me in resolving the below error
I am referring the sales data item in the following way in program but facing the error 'Sales' was not a uniquely defined name
Move ws-sales to sales of Dept.
Move ws-sales to sales of Area.
Code: |
01 Company PIC X(10).
01 State PIC X(10).
01 Dept.
05 DeptId PIC X(02).
05 Sales PIC X(10).
05 County.
10 Division.
15 DivisionCode PIC X(04).
15 Sales PIC X(10). |
|
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
To differentiate one from another, try this qualification -
Code: |
SALES OF DIVISION OF COUNTY
SALES OF DEPT |
HTH.... |
|
Back to top |
|
|
murugan_mf
Active User
Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
|
|
|
|
Have tried as per you suggestion
Facing error 'Sales' was not a uniquely defined name on the statement
Move ws-sales to sales of Dept
But there is no error highlighted for the statement
Move ws-sales to sales of Division of County |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
SALES OF DEPT is not enough to uniquely qualify the variable -- there are two SALES variables under DEPT. You are either going to (1) HAVE to change one of the SALES variable names, or (2) add a unique group name and place the 05-level SALES under that group name so you can uniquely reference it. SALES OF DIVISION OF COUNTY is a uniquely qualified variable name -- there is only one SALES variable under DIVISION and COUNTY, hence no error. SALES OF DIVISION or SALES OF COUNTY would also work to uniquely qualify the variable. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Defining 05 Sales as 05 DeptSales and 15 Sales as 15 DivisionSales would eliminate having to qualify Sales. |
|
Back to top |
|
|
murugan_mf
Active User
Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
|
|
|
|
Thanks all!! In my scenario, the data names cannot be changed hence I will add a unique group name to overcome the issue |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
Quote: |
the data names cannot be changed |
Why ? that's the corrective action than changing the whole program. Also Division looks a reserved word. |
|
Back to top |
|
|
murugan_mf
Active User
Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
|
|
|
|
Apologies. It was my mistake not providing the code correctly. This is the code snippet
Code: |
05 Sales-Data-County occurs 10 times.
10 Amount PIC 9(09)
10 Date PIC X(10)
05 Sales-Data-Area occurs 10 times
10 Amount PIC 9(09)
10 Date PIC X(10)
|
Now, when I am moving values to the field I am facing the following error IGYPS2072-S "OF" was invalid
Move ws-amount to Amount(ws-sub1) of Sales-Data-County |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
I suggest you consult the manual to see how to correctly qualify an item that is subscripted. |
|
Back to top |
|
|
murugan_mf
Active User
Joined: 31 Jan 2008 Posts: 148 Location: Chennai, India
|
|
|
|
It worked fine when I modified it as
Move ws-amount to Amount of Sales-Data-County(ws-sub1). Thanks All |
|
Back to top |
|
|
|