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
 

 

Getting SOC7 while adding num value to packed decimal field

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
nmr

New User


Joined: 27 Sep 2007
Posts: 14
Location: hyderabad

PostPosted: Tue Nov 06, 2007 1:59 pm    Post subject: Getting SOC7 while adding num value to packed decimal field
Reply with quote

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
View user's profile Send private message

vasanthkumarhb

Active User


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

PostPosted: Tue Nov 06, 2007 2:35 pm    Post subject:
Reply with quote

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..... icon_smile.gif

"Never Give Up Until U Succeed"
Back to top
View user's profile Send private message
murmohk1

Senior Member


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

PostPosted: Tue Nov 06, 2007 2:41 pm    Post subject:
Reply with quote

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
View user's profile Send private message
vasanthkumarhb

Active User


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

PostPosted: Tue Nov 06, 2007 2:59 pm    Post subject:
Reply with quote

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........... icon_smile.gif

"Never Give up Until u Succeed"
Back to top
View user's profile Send private message
Raphael Bacay

New User


Joined: 04 May 2007
Posts: 58
Location: Manila, Philippines

PostPosted: Tue Nov 06, 2007 3:20 pm    Post subject:
Reply with quote

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
View user's profile Send private message
vasanthkumarhb

Active User


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

PostPosted: Tue Nov 06, 2007 3:25 pm    Post subject:
Reply with quote

Hi Raphael,


Do you sure SOC7 is coming due to this reason.

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

Senior Member


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

PostPosted: Tue Nov 06, 2007 4:27 pm    Post subject: Reply to: Getting SOC7 while adding num value to packed deci
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Nov 06, 2007 4:32 pm    Post subject:
Reply with quote

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
View user's profile Send private message
vasanthkumarhb

Active User


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

PostPosted: Tue Nov 06, 2007 4:34 pm    Post subject:
Reply with quote

Aaru,


Thank you for the correction.

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

Active Member


Joined: 31 Oct 2006
Posts: 962
Location: Richmond, Virginia

PostPosted: Tue Nov 06, 2007 6:47 pm    Post subject:
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue Nov 06, 2007 7:39 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Wed Nov 07, 2007 1:15 am    Post subject:
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Nov 07, 2007 1:26 am    Post subject:
Reply with quote

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
View user's profile Send private message
Sandy Zimmer

Active Member


Joined: 13 Jun 2007
Posts: 826
Location: Wilmington, DE

PostPosted: Wed Nov 07, 2007 1:30 am    Post subject:
Reply with quote

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
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 INVALID FIELD OR CONSTANT IN SORTOF ?? Ron Klop DFSORT/ICETOOL 8 Wed Jan 11, 2017 3:44 pm
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 31 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am


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