Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Unable to create a SOC 7 abend

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
RedDevil711

New User


Joined: 04 Jun 2010
Posts: 25
Location: Pune

PostPosted: Fri Dec 10, 2010 11:22 am    Post subject: Unable to create a SOC 7 abend
Reply with quote

I am trying to create a SOC 7 abend using move from a character to numeric field but i am unable to do so , i am reading input data from a file
declarations for the variables are done as follows :

Code:
FILE SECTION.                 
FD FILE1.                     
01 EMP-RECORD       PIC X(80).
WORKING-STORAGE SECTION.     
01 STAT          PIC 9(2).   
01 STAT1        PIC S9(6) COMP-3.   
01 NAME         PIC X(6).     


Code:
MOVE EMP-RECORD(16:6) TO NAME.
MOVE NAME TO STAT1.           
ADD 1 TO STAT1.               
DISPLAY STAT1.                 
DISPLAY NAME.                 

When i execute the JCL STAT1 displays value as 121124
Even when INPUT field i.e EMP-RECORD(16:6) is populated as 121ABC

Can someone provide pointers on the same icon_smile.gif

Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Dec 10, 2010 5:31 pm    Post subject:
Reply with quote

Here is some explanation in this thread: http://www.ibmmainframes.com/viewtopic.php?t=51115&highlight=s0c7
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8201
Location: Dubuque, Iowa, USA

PostPosted: Fri Dec 10, 2010 5:33 pm    Post subject:
Reply with quote

The statement
Code:
MOVE NAME TO STAT1.
is converted to a PACK and MVN by COBOL. 121ABC is X'F1F2F1C1C2C3', which is packed into 121123 (the first nybble is ignored in a PACK operation), then 1 is added to it.

If you really want a S0C7, try this:
Code:
01  STATX PIC X(06).
01  STAT1 REDEFINES STATX PIC S9(6) COMP-3.

MOVE NAME TO STATX.
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1783
Location: Bloomington, IL

PostPosted: Sat Dec 11, 2010 11:06 pm    Post subject: Re: Unable to create a SOC 7 abend
Reply with quote

RedDevil711 wrote:
I am trying to create a SOC 7 abend using move from a character to numeric field

Why are you deliberately trying to generate a S0C7? Would your purpose be better served by calling CEE3ABD to cause a selectable user abend?
Back to top
View user's profile Send private message
RedDevil711

New User


Joined: 04 Jun 2010
Posts: 25
Location: Pune

PostPosted: Mon Dec 13, 2010 9:55 am    Post subject: Unable to create a SOC 7 abend
Reply with quote

Thanks a lot for the help
I am trying different scenarios for an abend scenario
So was deliberately creating a SOC 7
thanks for the help guys
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Dec 13, 2010 10:21 am    Post subject:
Reply with quote

Hello,

One way to cause a "real" s0c7 is to create a file with an invalid numeric value in a pacled-decimal field tha ts used in a calculation . . .

Then you can see exactly what happens to the real code when there is an invalid numeric.
Back to top
View user's profile Send private message
prem_ibm

New User


Joined: 15 Sep 2007
Posts: 31
Location: Chennai

PostPosted: Mon Dec 13, 2010 4:27 pm    Post subject: Reply to: Unable to create a SOC 7 abend
Reply with quote

Hi ,
One way is write small cobol programme and accept the data through SYSIN DD * ....Declare the data type numeric and pass the non numberic value or any junk value....u will get SOC7.

Thanks
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8201
Location: Dubuque, Iowa, USA

PostPosted: Mon Dec 13, 2010 5:05 pm    Post subject:
Reply with quote

prem_ibm, your answer is not accurate.
Code:
PIC 9(02).
is a numeric variable declaration, but if you ACCEPT that variable, you will not get any S0C7 abends -- no matter the value in the input file. Please test things before you post to prevent inaccurate statements such as this.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Unable to send mail with SMTP commands harsh.saxena579 JCL & VSAM 10 Tue Dec 12, 2017 1:58 pm
No new posts Looping REXX - unable to interrupt RAVISANKAR07 CLIST & REXX 3 Wed Dec 06, 2017 1:08 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am
No new posts How to create issuer certificate? :'( vasanthz All Other Mainframe Topics 1 Sat Nov 18, 2017 5:14 am
No new posts ASP3 ABEND IN CICS Vedant CICS 0 Fri Oct 20, 2017 3:18 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us