Hi ther,
I am experience a very strange problem in COBOL.
I have an variable defined as COMP-3 and all I want to do is ADD 1 to it. However, when I do this via the ADD statement I get a data exception error. I have tried a number of ways changing the 1 to +1, +001 etc, the Add to Compute etc. with no success.
The strange thing is that I have a similar variable defined in this same way on which I can perform the ADD with no issues at all.
Help would be greatly appreciated.
Thanks
Vanessa
Data exception error in COBOL
- dick scherrer
- Global moderator
- Posts: 6268
- Joined: Sat Jun 09, 2007 8:58 am
Re: Data exception error in COBOL
Hello Vanessa and welcome to the forums,
You need to initialize your variable to zero before executing an add/compute to that variable. The literal being used is not the problem, the variable is the problem.
All variables (especially numeric variables) should be initialized.
You need to initialize your variable to zero before executing an add/compute to that variable. The literal being used is not the problem, the variable is the problem.
All variables (especially numeric variables) should be initialized.
Hope this helps,
d.sch.
d.sch.
-
- Similar Topics
- Replies
- Views
- Last post
-
-
Skip last 3 bytes and first 3 bytes of data in cobol
by senthamizh » Wed Dec 21, 2022 7:26 pm » in IBM Cobol - 2
- 1793
-
by Robert Sample
View the latest post
Thu Dec 22, 2022 9:18 am
-
-
- 1
- 1491
-
by sergeyken
View the latest post
Sun Oct 04, 2020 11:33 pm
-
- 3
- 6849
-
by socker_dad
View the latest post
Wed May 04, 2022 12:59 am
-
- 7
- 4093
-
by jcdm
View the latest post
Tue Jul 25, 2023 11:57 am
-
- 1
- 4700
-
by jcdm
View the latest post
Mon Jul 17, 2023 3:48 pm