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

SOC7 abend while moving COMP-3 variable to a normal variable


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

New User


Joined: 07 Feb 2007
Posts: 22
Location: hyderabad

PostPosted: Tue Jul 29, 2008 10:51 am
Reply with quote

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

Senior Member


Joined: 03 Jul 2007
Posts: 1287
Location: Chennai, India

PostPosted: Tue Jul 29, 2008 11:26 am
Reply with quote

srikar,

Code:
UNA-OLD-EMPL-NBR


what is the picture clause of the above field?
Back to top
View user's profile Send private message
srikar tenali

New User


Joined: 07 Feb 2007
Posts: 22
Location: hyderabad

PostPosted: Tue Jul 29, 2008 12:04 pm
Reply with quote

sorry that was,

Code:

MOVE LS-OLD-EMPL-NBR         TO WS-OLD-EMPL-NBR           
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Tue Jul 29, 2008 12:36 pm
Reply with quote

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

JCL Moderator


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

PostPosted: Tue Jul 29, 2008 9:25 pm
Reply with quote

Not only that but COMP-3 variables are offended you refer to them as "abnormal". icon_smile.gif
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts ISAM and abend S03B JCL & VSAM 10
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts COBOL - Move S9(11)v9(7) COMP-3 to -(... COBOL Programming 5
Search our Forums:

Back to Top