View previous topic :: View next topic
|
Author |
Message |
sudhakar_lendave
New User
Joined: 21 Nov 2006 Posts: 48 Location: mumbai
|
|
|
|
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 |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Because X'40' is not a valid number.....Why are you trying to add a space to the total? |
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
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.... |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
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 |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
martin9
Active User
Joined: 01 Mar 2006 Posts: 290 Location: Basel, Switzerland
|
|
|
|
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 |
|
|
hemanth.nandas
Active User
Joined: 18 Aug 2007 Posts: 120 Location: India
|
|
|
|
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 |
|
|
|