Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Abend with COBOL Redefine Clause

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Abend with COBOL Redefine Clause
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: 2150
Location: At my coffee table

PostPosted: Tue Oct 09, 2007 4:02 pm    Post subject:
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: 276
Location: Bang,iflex

PostPosted: Tue Oct 09, 2007 4:14 pm    Post subject: Hi....
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: 1439
Location: Bangalore,India

PostPosted: Tue Oct 09, 2007 4:17 pm    Post subject:
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: 1288
Location: Chennai, India

PostPosted: Tue Oct 09, 2007 4:32 pm    Post subject: Reply to: Abend with COBOL Redefine Clause
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: 287
Location: Basel, Switzerland

PostPosted: Tue Oct 09, 2007 4:34 pm    Post subject:
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: Chennai

PostPosted: Tue Oct 09, 2007 4:36 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us