View previous topic :: View next topic
|
Author |
Message |
nmr
New User
Joined: 27 Sep 2007 Posts: 14 Location: hyderabad
|
|
|
|
i am getting soc7 find below screen
==> IF QK-DURBASE-Y = OD-DUR + 2
=>
=> ASRA ABEND (0C7) detected and prevented. Caused by invalid decimal
=> arithmetic data format.
=>
=> Press PF1 for a detailed description.
=>
---------------------------------------------------------
data type declaration for the variables
05 QK-DURBASE.
10 QK-DURBASE-Y PIC S99 VALUE ZERO.
OD-DUR PIC S999 COMP-3.
can any body give me some idea? |
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
Hi,
A SOC7 is a data exception. It occurs when you try to move a non-numeric data into a numeric data item. Check the data in the (OD-DUR PIC S999 COMP-3. ). You might be getting SOC7 because COMP-3 variable contains PACKED DECIMAL values and the one variable you are adding with contains numeric data.
Any Suggesstion Accepted.
_________________
Regard's
Vasanth.....
"Never Give Up Until U Succeed" |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Vasanth,
Quote: |
COMP-3 variable contains PACKED DECIMAL values and the one variable you are adding with contains numeric data. |
Tell me you are not serious and just joking. |
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
Hi Murali,
I just want him to check the data either by manually or Exped the variables, He may be getting SOC7 may be due to garbage value in the comp-3 variable.
Just i need to inform him the data format in both the variable types.
That's y i put the words like that, leads in confusion.
with apology
Regard's
Vasanth...........
"Never Give up Until u Succeed" |
|
Back to top |
|
|
Raphael Bacay
New User
Joined: 04 May 2007 Posts: 58 Location: Manila, Philippines
|
|
|
|
Hi,
I don't htink it is possible to have an arithmetic operation on a conditional.
Maybe you can just make a temp field
TEMP = OD-DUR + 2
IF QK-DURBASE-Y = TEMP
to avoid the SOC-7
Thanks. |
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
Hi Raphael,
Do you sure SOC7 is coming due to this reason.
Regard's
Vasanth...... |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
vasanth,
Quote: |
A SOC7 is a data exception. It occurs when you try to move a non-numeric data into a numeric data item. |
Moving a non-numeric data to a pic 9 display format field will NOT cause an 0C7. You will get that abend only when you attempt to perform arithmetic operations with the pic 9 field containing invalid data.
If am right this was discussed few days before. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
don't htink it is possible to have an arithmetic operation on a conditional
|
I am reasonably sure what you mean, but what you said makes no sense - you are not using the word conditional properly.The IF statement is syntactically correct.
QK-DURBASE-Y and QK-DURBASE both define the same memory, one is numeric and the other is alpha. I would guess that the durbase field contains non-numerics.
but, as said before, either use displays or xpeditor to see what is in the fields, and then determine how the non-numerics ended-up in numeric fields. |
|
Back to top |
|
|
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 275 Location: Bang,iflex
|
|
|
|
Aaru,
Thank you for the correction.
Regard's
Vasanth.......... |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1050 Location: Richmond, Virginia
|
|
|
|
This thread make very clear an important concept:
If you really want to know if something work - try it yourself, or look it up first, rather than relying on others who may not know more than you do.
Conditional statements in almost all languages do allow arbitrarily complicated expressions.
Moving garbage to a packed decimal field is OK (as clarified above) - just don't try to use it.
Packed decimal is numeric, as is binary and display. It's the contents that make it numeric or otherwise, not the form in which it is coded. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi PP,
As I recall, a move to a COMP-3 field generates an Assembler ZAP (zero and add packed) instruction.
That's an arithmatic instruction and will cause an 0C7.
Display numeric moves generate an MVC (move char) instruction and this won't cause an 0C7.
And of course, ANYTHING in a COMP field is a valid numeric and won't cause an 0C7. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
How about - did you initialize your working storage fields at the GROUP level. Group levels are always alpha-numeric.
[I don't htink it is possible to have an arithmetic operation on a conditional.]
I think Raphael is correct. You may want to code it as
[compute ws-temp-fld = QK-DURBASE-Y + 2
on size error, etc - do something imperative]
[/quote][/code] |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Sandy Zimmer wrote: |
[I don't htink it is possible to have an arithmetic operation on a conditional.]
I think Raphael is correct. You may want to code it as
[compute ws-temp-fld = QK-DURBASE-Y + 2
on size error, etc - do something imperative]
|
[/code][/quote]
BS
Either QK-DURBASE-Y or OD-DUR contains invalid data. |
|
Back to top |
|
|
Sandy Zimmer
Active Member
Joined: 13 Jun 2007 Posts: 826 Location: Wilmington, DE
|
|
|
|
Craq Giegerich,
Yes, "on size error" will catch anything not numeric. Then he will know exactly which field is the problem. Who is BS? |
|
Back to top |
|
|
|