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

Facing error IGYPS0037-S


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Wed Jun 01, 2016 4:36 pm
Reply with quote

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
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Jun 01, 2016 5:59 pm
Reply with quote

To differentiate one from another, try this qualification -
Code:

SALES OF DIVISION OF COUNTY
SALES OF DEPT

HTH....
Back to top
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Wed Jun 01, 2016 6:12 pm
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Wed Jun 01, 2016 6:24 pm
Reply with quote

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
View user's profile Send private message
Terry Heinze

JCL Moderator


Joined: 14 Jul 2008
Posts: 1249
Location: Richfield, MN, USA

PostPosted: Wed Jun 01, 2016 6:54 pm
Reply with quote

Defining 05 Sales as 05 DeptSales and 15 Sales as 15 DivisionSales would eliminate having to qualify Sales.
Back to top
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Wed Jun 01, 2016 7:02 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Wed Jun 01, 2016 10:47 pm
Reply with quote

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
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Thu Jun 02, 2016 10:40 am
Reply with quote

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
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jun 02, 2016 11:13 am
Reply with quote

I suggest you consult the manual to see how to correctly qualify an item that is subscripted.
Back to top
View user's profile Send private message
murugan_mf

Active User


Joined: 31 Jan 2008
Posts: 148
Location: Chennai, India

PostPosted: Thu Jun 02, 2016 3:18 pm
Reply with quote

It worked fine when I modified it as
Move ws-amount to Amount of Sales-Data-County(ws-sub1). Thanks All
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 Error to read log with rexx CLIST & REXX 11
No new posts Error when install DB2 DB2 2
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts Error while running web tool kit REXX... CLIST & REXX 5
No new posts Getting Error while trying to establi... DB2 3
Search our Forums:

Back to Top