MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Need help On S0C7 error

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
vjkumk
Beginner


Joined: 28 Sep 2005
Posts: 98
Topics: 33

PostPosted: Wed Jan 11, 2006 10:15 am    Post subject: Need help On S0C7 error Reply with quote

i have already gone through the forum about S0C7 error,they all deals about how to find the statement which caused the error.but my problem is ,I am working on cics and pli environment,i have a VSAM file which consists of character and fixed decimal data.Some times the fixed decimal data can have junk value.

i am using a structure like below

dcl 1 recdata,
2 chrdata char(2),
2 fxddata fixed decimal(3,0),
2 chrdata1 char(76);

the record length of the file is 80


after i read the Vsam file in to the above structure and that particular record in the vsam file contains junk value at the position of fixed decmial data it causes no problem(While reading in to the struture).If i tried to access that particular fixed decimal variable for other operation ,it causes the S0C7 error.

so my question is ,there is any solution to find the fixed decimal variable contains junk data prior to accessing that variable. and changing its value to valid data?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Wed Jan 11, 2006 10:30 am    Post subject: Reply with quote

vjkumk,

Convert the data starting from 3 for a length of 2 bytes into HEX( see here for cobol example)

Now check the 4th byte in the hex string for a 'C' (positive) 'D' (negative). If you have any of the 2 values then it is a valid value. If not move X'000C' (zero) to the field.

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
German Castillo
Beginner


Joined: 23 Dec 2005
Posts: 83
Topics: 2
Location: Caracas, Venezuela

PostPosted: Wed Jan 11, 2006 2:34 pm    Post subject: Reply with quote

Hello vjkumk,

Depending upon the language you are using, you may have test able to perform.

In Rexx, use Datatype(chrdata), unfortunately this test is good only for displayable decimal numbers, useless for packed/binaries ones. i.e. DATATYPE(chrdata) = 'NUM' or DATATYPE(chrdata, 'N') = 1 will do it.
In Cobol, use 'IS NUMERIC' (Redefine your numeric field as Pic X, testing this redefined var if you want). i.e. IF chrdata_r IS NUMERIC
In Assembler use the TRT instruction. You will have to build two separate tables, one for the byte sign and the other for the remaining bytes. i.e.
Code:

*  Move or redefine your test field to SIGN and remaining,
* If you move it just remember to revert the change done below
* to SIGN once you are done with the test
    PACK SIGN,SIGN      Revert sign byte (easier test table)
    TRT SIGN,TABLE_S
    BZ ERROR
    TRT REMAINING,TABLE_R
    BZ ERROR
    ...
TABLE_S  DC  256 XL1'01'
     ORG   TABLE_S+x'C0'
     DC     DC  XL10'00'
     ORG   TABLE_S+x'D0'
     DC     DC  XL10'00'
     ORG   TABLE_S+x'F0'
     DC     DC  XL10'00'
     ORG ,
TABLE_R  DC  256 XL1'01'
     ORG   TABLE_R+x'00'
     DC     DC  XL10'00'
     ORG   TABLE_R+x'10'
     DC     DC  XL10'00'
     ...
     ORG   TABLE_R+x'90'
     DC     DC  XL10'00'
     ORG ,
...

_________________
Best wishes,

German Castillo
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group