View previous topic :: View next topic
|
Author |
Message |
srikar tenali
New User
Joined: 07 Feb 2007 Posts: 22 Location: hyderabad
|
|
|
|
hi,
Following is the declaration of variables.
Code: |
10 LS-EMPLOYEE-DATA-GRP.
15 LS-EMPL-KEY.
20 LS-EMPL-NBR PIC S9(13) COMP-3.
15 LS-OLD-EMPL-KEY REDEFINES LS-EMPL-KEY.
20 LS-OLD-EMPL-NBR
PIC S9(9) COMP-3.
20 LS-OLD-EMPL-SUB-NBR
PIC S9(3) COMP-3.
|
there can be no changes in the above declaration as this is a predefined variables in the system and working perfectly for all other programs.
Code: |
05 WS-OLD-EMPL-KEY.
10 WS-OLD-EMPL-NBR PIC S9(09).
10 WS-OLD-EMPL-SUB-NBR
PIC S9(03).
|
With the above declaration, the program is getting abended in the following statement.
Code: |
MOVE LS-OLD-EMPL-NBR TO UNA-OLD-EMPL-NBR
|
Please help to resolve.
Thanks in advance.
Srikar |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
srikar,
what is the picture clause of the above field? |
|
Back to top |
|
|
srikar tenali
New User
Joined: 07 Feb 2007 Posts: 22 Location: hyderabad
|
|
|
|
sorry that was,
Code: |
MOVE LS-OLD-EMPL-NBR TO WS-OLD-EMPL-NBR
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
there can be no changes in the above declaration as this is a predefined variables in the system and working perfectly for all other programs. |
The data definition code is simply wrong and will most likely fail (as you have seen). If the code works it is because someone coded around the improper definitions.
There are 2 comp-3 fields defined and that would require 2 signs and when a value is moved to LS-EMPL-NBR the move will destroy the sign on the first field in the redefinition.
The short-term resolution is probably to find the way the "working" programs are coded and follow the same scheme. I'd also suggest placing comments in all of the code that uses these definitions to alert the next person who has to work with it. If the definitions are a copybook, placing comments in the copybook would be a good thing as well. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Not only that but COMP-3 variables are offended you refer to them as "abnormal". |
|
Back to top |
|
|
|