Page 1 of 1

Replace spaces by signed zeroes

PostPosted: Wed May 07, 2008 5:06 pm
by kihaho
I have a record that has spaces in the signed numeric field that is causing S0C7 and would like to put a permanent patch in the program. It is to replace spaces with zeroes but it should have { in the last field.

The field is defined as this:
07 R-CLM-NUM-TOT-CLM-AMT-PAID PIC S9(10)V99.

I've tried "Inspect" statement but it all came out 0000000000 instead of 000000000{ and S0C7 did not go away.

Inspect R-CLM-NUM-TOT-CLM-AMT-PAID replacing all spaces by 0.

Any of your advice would be very much appreciated.
Thank you!!!

Re: Replace spaces by signed zeroes

PostPosted: Wed May 07, 2008 7:05 pm
by dick scherrer
Hello kihaho and welcome to the forums,

Inspect R-CLM-NUM-TOT-CLM-AMT-PAID replacing all spaces by 0.

Instead of this, try
IF R-CLM-NUM-TOT-CLM-AMT-PAID NOT NUMERIC MOVE ZEROS TO R-CLM-NUM-TOT-CLM-AMT-PAID.

Re: Replace spaces by signed zeroes

PostPosted: Wed May 07, 2008 8:22 pm
by kihaho
Hello Dick,
Your patch worked beutifully!!!
Thank you so much for the life saving advice.
You saved me from endless nightly calls for the hangs.
I will be able to sleep peacefully from now on.
I really appreciate it.
Kihaho :D

Re: Replace spaces by signed zeroes

PostPosted: Wed May 07, 2008 8:30 pm
by CICS Guy
kihaho wrote:The field is defined as this:
07 R-CLM-NUM-TOT-CLM-AMT-PAID PIC S9(10)V99.

I've tried "Inspect" statement but it all came out 0000000000 instead of 000000000{
s9(10)v99 is 12 digits and the string of zeros are only 10 digits, what gives? If that is only a typo,
and S0C7 did not go away.
then you aren't looking at the correct abend cause....
Go with Dick's not numeric choice, it works much better......

BTW, the '0' is X'F0' and the '{' is X'C0', numerically equal...........

Re: Replace spaces by signed zeroes

PostPosted: Wed May 07, 2008 8:36 pm
by kihaho
Hi CICS Guy,
Thanks for your feedback.
It was just a typo and as I said, Dick's suggestion worked fine.
Thank you for watching over though. :D

Re: Replace spaces by signed zeroes

PostPosted: Thu May 08, 2008 4:17 am
by dick scherrer
Hi Kihaho,

Good to hear that it is now working as needed.

Thanks for posting the update :)

d