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: 8154
Location: East Dubuque, Illinois, 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: 1775
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: 8154
Location: East Dubuque, Illinois, 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 Create procedure issues -628 when add... chandraBE DB2 1 Mon Sep 18, 2017 12:16 pm
No new posts How do I create a mainframe monitorin... anjali.bisht All Other Mainframe Topics 4 Fri Sep 01, 2017 2:20 pm
This topic is locked: you cannot edit posts or make replies. rexx to create a tso command Bharath Vikraman CLIST & REXX 1 Tue Aug 08, 2017 3:32 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am
No new posts How do you create Eclipse based dialogs jasorn IBM Tools 0 Thu Aug 03, 2017 5:05 pm

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