S0C 7 abend while comparing 2 comp3 variable



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

S0C 7 abend while comparing 2 comp3 variable

Postby sunny_io » Mon Feb 09, 2009 1:10 am

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
You do not have the required permissions to view the files attached to this post.
sunny_io
 
Posts: 2
Joined: Mon Feb 09, 2009 12:41 am
Has thanked: 0 time
Been thanked: 0 time

Re: S0C 7 abend while comparing 2 comp3 variable

Postby dick scherrer » Mon Feb 09, 2009 2:58 am

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).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: S0C 7 abend while comparing 2 comp3 variable

Postby sunny_io » Tue Feb 10, 2009 12:11 am

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
sunny_io
 
Posts: 2
Joined: Mon Feb 09, 2009 12:41 am
Has thanked: 0 time
Been thanked: 0 time

Re: S0C 7 abend while comparing 2 comp3 variable

Postby dick scherrer » Tue Feb 10, 2009 12:49 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post