Page 1 of 1

soc-7 question

Posted: Fri Dec 27, 2013 6:10 pm
by Deepakkumar
Hi everyone..

As we know soc7 come when we doing any arithmetic operation on non numeric data. thats i know.
and we can got a soc7 by using this code.

Code: Select all

ID DIVISION.
 PROGRAM-ID. "DEEPAK". 
DATA DIVISION.
 WORKING-STORAGE SECTION.
 01 A PIC X(4) VALUE 'A###'.
 01 B PIC S9(2)V99 COMP-3.
 PROCEDURE DIVISION. 
MOVE A TO B.
 DISPLAY "VALUE OF A ", B. 
STOP RUN.
this code shows soc7..
but i want a code of soc7 with out using comp-3 only by numeric and alphanumeric..
can any one give me any idea, how can i get it..

Re: soc-7 question

Posted: Fri Dec 27, 2013 6:19 pm
by William Collins
You're going to have to be clear about what you mean. You know what you want, but we don't. Why would you want a S0C7 particularly? If you want a S0C7 with USAGE DISPLAY instead of USAGE COMP-3, why not try some arithmetic?

Re: soc-7 question

Posted: Fri Dec 27, 2013 6:38 pm
by Deepakkumar
@ william :thanks for reply.....william i tried but did not get soc7. i need a soc7 with out using comp-3....
appreciate of your comment..

Re: soc-7 question

Posted: Fri Dec 27, 2013 7:16 pm
by William Collins
Why do you need a S0C7? Why post the same question elsewhere? Is it a contest of some type?

Re: soc-7 question

Posted: Fri Dec 27, 2013 7:36 pm
by Robert Sample
Generating S0C7 ABENDS is actually pretty easy -- once you understand the internal formats and how they work. This COBOL code will generate one:

Code: Select all

 WORKING-STORAGE SECTION.
 01  WS-VAR-X                    PIC X(04) VALUE ',,,,'.
 01  WS-VAR                      REDEFINES WS-VAR-X
                                 PIC 9(04).
*==========================================================
 PROCEDURE DIVISION.
 A000-MAINLINE SECTION.
     ADD 1                       TO  WS-VAR.

     STOP RUN.
And just so you know, Deepakkumar, a S0C7 requires COMP-3 data somewhere -- explicitly defined, or implicitly referenced as in my code. Without packed decimal data, you CANNOT have a S0C7.

Re: soc-7 question

Posted: Fri Dec 27, 2013 8:00 pm
by Deepakkumar
THANKS Robert sample for your relpy...
Really appreciate your work..

Re: soc-7 question

Posted: Fri Dec 27, 2013 8:14 pm
by William Collins
We thought from your original post that you'd already done that.

There are other ways to get a S0C7.

If you are genuinely researching the subject, or entering a competition and doing the work solely on your own, then you should consult the Principles of Operation.

Re: soc-7 question

Posted: Sat Dec 28, 2013 6:11 am
by dick scherrer
Questions like this should always be posted in the forum rather than via PM. We do not support technical dialog via PM.

As an add-on to Robert's explanation. Just because you do not see a packed-decimal/comp-3 field in the code, this does not mean one is not used . . .

Who believes there is a need to do what you want to do?

Re: soc-7 question

Posted: Sat Dec 28, 2013 9:51 am
by Anuj Dhawan
Hi Deepakkumar,

It's not advisable to write PM to helping heads here, that's not something we encourage. In private, you can talk about something personal but nothing about your technical-topics.

What is that which is not clear, in this thread, to you. Robert has given an exact sample code which you might need, even if it's a trick question. Can you back-up your intention to write a PM? If not, please do not write PM for technical help.

Thanks,

Re: soc-7 question

Posted: Sat Dec 28, 2013 7:12 pm
by Deepakkumar
sorry anuj. In future, I will will take of it. :)
Thanks for every one who gave their suggestion :)

Re: soc-7 question

Posted: Sat Dec 28, 2013 8:07 pm
by Anuj Dhawan
No problem Deepak. Hope you got the answer what you were looking for.

Have a nice stay here,

Thanks,
Anuj