Posted: Wed Jan 11, 2006 10:15 am Post subject: Need help On S0C7 error
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.
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?
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.
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 ,
...
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