Page 1 of 1

S0C 7 abend while comparing 2 comp3 variable

PostPosted: Mon Feb 09, 2009 1:10 am
by sunny_io
Hi All.

In my attachment I have put the screen shot of debug screen just before my program abends !!

The 2 variables are both defined ad s9(13) comp-3 ( vaiables name - zzeroes and tran-amount ) and debug shows , one has value = 0 and other also has something ( not spaces ) then i don get it why is program abending with Soc 7

IF TRAN-AMOUNT > ZZEROES is the condition that gives the soc7 abend ..

Help appreciated .

Sunny
New Bitmap Image.jpg

Re: S0C 7 abend while comparing 2 comp3 variable

PostPosted: Mon Feb 09, 2009 2:58 am
by dick scherrer
Hello and welcome to the forum,

Please do not post screenshots - they cause more clutter and confusion than they provide useful info. Using copy/paste and the "Code" tag will present your info quite readably. Use the Preview to see your post as it will appear to the forum (the reply editor is not how the post will actually appear). When you are satisfied with how your post appears, then Submit.

The 0c7 is because the content of the tran-amount field is not numeric. Either the data is invalid or the record layout is wrong. You need to determine which and make the appropriate change(s).

Re: S0C 7 abend while comparing 2 comp3 variable

PostPosted: Tue Feb 10, 2009 12:11 am
by sunny_io
Hi.
I wil surely keep that in mind ( screen shot thing ) . Can you pls explains how did u determine thats its not numeric data in TRAN AMOUNT field.
By looking at hex value X"00000017970C00" ?
Thanks
Sushant

Re: S0C 7 abend while comparing 2 comp3 variable

PostPosted: Tue Feb 10, 2009 12:49 am
by dick scherrer
Hello,

A packed-decimal (comp-3) value must have a C, D, or F sign in the low-order half-byte (nibble). The hex value poted does not. The low order byte is x'00' which is not valid as the low order byte of a comp-3 field.

Notice, immediately before the x'00' is an byte containing x'0C'. This would be a valid comp-3 low-order byte.

So, either the data is incorrect or the layout is incorrect. From what has been posted, i cannot tell which.