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

Abend with COBOL Redefine Clause


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

New User


Joined: 21 Nov 2006
Posts: 48
Location: mumbai

PostPosted: Tue Oct 09, 2007 4:00 pm
Reply with quote

Following is the my code which abending.
Can you please tell me why it happening.

Code:

01  WS-ERROR-SECTION       PIC X(02)      VALUE SPACES.
01  FILLER REDEFINES WS-ERROR-SECTION.                 
    05  WS-ADD-SPACE       PIC 9(01).                 
    05  WS-TOTAL           PIC 9(01).
.
.
..


ADD WS-ADD-SPACE TO WS-TOTAL.
.
.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Tue Oct 09, 2007 4:02 pm
Reply with quote

Because X'40' is not a valid number.....Why are you trying to add a space to the total?
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 275
Location: Bang,iflex

PostPosted: Tue Oct 09, 2007 4:14 pm
Reply with quote

Hi....


You already passed the spaces in to 'X' variable, and in the PROCEDURE DIVISION you are adding Spaces and the numeric variable, Its an DATA EXCEPTION... you might be getting SOC7 as abend...

You cannot add spaces and numerals.

Regard's
Vasanth.... icon_smile.gif
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Tue Oct 09, 2007 4:17 pm
Reply with quote

Vasanth,

Quote:
in the PROCEDURE DIVISION you are adding Spaces and the numeric variable

Numeric variables are redefines of PIC X variable. Can you tell where he is adding numeric and non-numeric data?
Back to top
View user's profile Send private message
Aaru

Senior Member


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

PostPosted: Tue Oct 09, 2007 4:32 pm
Reply with quote

Quote:
in the PROCEDURE DIVISION you are adding Spaces and the numeric variable


He is not adding spaces to numerals, but doing a numeric operation on a field which has spaces.
Back to top
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Tue Oct 09, 2007 4:34 pm
Reply with quote

Hy,

before computing, pls make sure the WS-ADD-SPACE contains a legal numeric value. the negativ impact you know already... :-)

martin9
Back to top
View user's profile Send private message
hemanth.nandas

Active User


Joined: 18 Aug 2007
Posts: 120
Location: India

PostPosted: Tue Oct 09, 2007 4:36 pm
Reply with quote

Hi All,

Quote:
01 WS-ERROR-SECTION PIC X(02) VALUE SPACES.
01 FILLER REDEFINES WS-ERROR-SECTION.
05 WS-ADD-SPACE PIC 9(01).
05 WS-TOTAL PIC 9(01).
.
.
..


ADD WS-ADD-SPACE TO WS-TOTAL.


Before doing arthematic operation on it,
Do initialize WS-ADD-SPACE, WS-TOTAL,
I mean,

Code:
MOVE ZERO TO WS-ADD-SPACE
                                   WS-TOTAL.



Then Move your values into those variable, perform arthematic operation.

Code:
MOVE 2 T0 WS-ADD-SPACE.
MOVE 1 TO WS-TOTAL.

ADD WS-ADD-SPACE TO WS-TOTAL.


Thanks & Regards
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 Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts ISAM and abend S03B JCL & VSAM 10
Search our Forums:

Back to Top