Regarding SOC7 or SOC 's



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

Regarding SOC7 or SOC 's

Postby kandrepavan » Tue Aug 14, 2012 10:30 am

Hi All,

Please can any one post a code for getting soc7 error in sample cobol program(in detail).
Please execute and post it.

Thanx and regards.
pavan
kandrepavan
 
Posts: 35
Joined: Wed Mar 21, 2012 11:03 am
Has thanked: 0 time
Been thanked: 1 time

Re: Regarding SOC7 or SOC 's

 

Re: Regarding SOC7 or SOC 's

Postby NicC » Tue Aug 14, 2012 10:53 am

Why not try yourself. If you want us to do your work for you, how much are you prepared to pay us?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Postby kandrepavan » Tue Aug 14, 2012 11:25 am

Hi All,

I tried ...but i could not..get....
and will you reply if u are paid .....? then please dont reply to any ones post
Thanx in advance
pavan
kandrepavan
 
Posts: 35
Joined: Wed Mar 21, 2012 11:03 am
Has thanked: 0 time
Been thanked: 1 time

Re: Regarding SOC7 or SOC 's

Postby NicC » Tue Aug 14, 2012 11:27 am

Yup, send me the money and I will code up a job that will do the necessary and mail you the results. But it will be a LOT cheaper to google s0c7, as I did just now, and read some of the links.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: Regarding SOC7 or SOC 's

Postby Monitor » Tue Aug 14, 2012 12:19 pm

The 0C7, Data Exception, is normally not a programming error. Data from files or databases are not in the format that the program expects.
So, any program is a candidate for a 0C7-abend.
Read on as suggested.
Monitor
 
Posts: 98
Joined: Wed Jan 18, 2012 8:59 pm
Has thanked: 0 time
Been thanked: 7 times

Re: Regarding SOC7 or SOC 's

Postby Monitor » Tue Aug 14, 2012 1:39 pm

Here is a free one!

Identification Division.                       
Program-Id. ABEND0C7.                           
Data Division.                                 
Working-Storage Section.                       
01 TheData.                                     
   05 TheCharacter   Pic X(02) Value 'A'.       
   05 TheNumber      Redefines TheCharacter     
                     Pic 9(02) Packed-Decimal. 
Procedure Division.                             
    Add 1 to TheNumber                         
    GoBack                                     
    .                                           
Monitor
 
Posts: 98
Joined: Wed Jan 18, 2012 8:59 pm
Has thanked: 0 time
Been thanked: 7 times

Re: Regarding SOC7 or SOC 's

Postby BillyBoyo » Tue Aug 14, 2012 2:41 pm

pavan,

To get a Data Exception, you need to arrange that an instruction which can create one is used.

If you do some research, you should get to references in the Principles of Operation which gives you a fairly short list of assembler instructions that can cause a S0C7. If you have trouble finding the list, search the document for CVB.

All the instructions relate to packed-decimal data, so a packed-decimal (aka COMP-3) data definition is a good candidate to start with.

You then need to know what will cause the S0C7.

You should discover that all the "digits" part must be between 0 and 9, in each hafl-byte, and that the right-most half-byte contains the "sign" and should also have a specific valid value.

However, the thing about the "sign" is not the end of the story, as the Enterprise Cobol compile option NUMPROC comes into it (if you have a different mainframe Cobol, it is a different option).

If you want to go with Monitor's example, make sure you have NUMPROC(PFD).

Also another Cobol thing is the treatment of signed and non-signed data. If you look for references to "sign fixing" and "sign rectification" you'll start to get some idea of what goes on there. Don't worry if you don't understand everything at once, but there will be occasions you'll say to yourself "why didn't that abend?" or "why did that abend?" and then you'll have some ideas about what to consider.

A more secure way to obtain a S0C7 is to forget the sign and go for the digits part.
    01 TheData.                                     
       05 TheCharacter   Pic X(02) Value '.A'.       
       05 TheNumber      Redefines TheCharacter     
                         Pic S9(03) Packed-Decimal.


I've made a couple of changes to Monitor's definition. I've change the value to ".A" from "A ". In hex this should show you "4BC1" where the B, C and 1 (in the sign) are all potential S0C7 causers. NUMPROC might "mess you about" with the "1", but the B and the C will either of them in those positions definitely abend 100% of the time. I've also made the redefinition signed and made the field size an exact match.

PS. Don't think you can just copy and paste all that I have written above and put it into your homework. This is an explanation of how to find out the detail, not of the detail itself. If you want to post what you discover from your research and any questions you have on that, you'll receive appropriate clarifications.

PPS. I also think it would lead you to far more detail than is required for your assignment. It could easily take a couple of years to comprehend all the information you get to, so for now get a grip on the "numeric" in the numeric part, "valid sign" in the sign part, and be aware that NUMPROC can upset your thoughts about the sign, so go with clobbering something in the numeric part.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Regarding SOC7 or SOC 's

Postby dick scherrer » Tue Aug 14, 2012 7:02 pm

Hello,

Regarding SOC7 or SOC 's
If you want to force an S0CB, divide some valid number by zero . . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post