soc-7 question

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Deepakkumar
New Member
Posts: 5
Joined: Wed Dec 25, 2013 5:07 pm

soc-7 question

Post 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..
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: soc-7 question

Post 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?
Deepakkumar
New Member
Posts: 5
Joined: Wed Dec 25, 2013 5:07 pm

Re: soc-7 question

Post 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..
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: soc-7 question

Post by William Collins »

Why do you need a S0C7? Why post the same question elsewhere? Is it a contest of some type?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1885
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: soc-7 question

Post 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.
Deepakkumar
New Member
Posts: 5
Joined: Wed Dec 25, 2013 5:07 pm

Re: soc-7 question

Post by Deepakkumar »

THANKS Robert sample for your relpy...
Really appreciate your work..
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: soc-7 question

Post 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.
dick scherrer
Former Team Member
Posts: 62
Joined: Wed Aug 07, 2013 6:43 pm

Re: soc-7 question

Post 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?
Hope this helps,
d
User avatar
Anuj Dhawan
Founder
Posts: 2799
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: soc-7 question

Post 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,
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Deepakkumar
New Member
Posts: 5
Joined: Wed Dec 25, 2013 5:07 pm

Re: soc-7 question

Post by Deepakkumar »

sorry anuj. In future, I will will take of it. :)
Thanks for every one who gave their suggestion :)
User avatar
Anuj Dhawan
Founder
Posts: 2799
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: soc-7 question

Post by Anuj Dhawan »

No problem Deepak. Hope you got the answer what you were looking for.

Have a nice stay here,

Thanks,
Anuj
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”