Replace spaces by signed zeroes



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Replace spaces by signed zeroes

Postby kihaho » Wed May 07, 2008 5:06 pm

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!!!
kihaho
 
Posts: 19
Joined: Tue May 06, 2008 11:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Replace spaces by signed zeroes

 

Re: Replace spaces by signed zeroes

Postby dick scherrer » Wed May 07, 2008 7:05 pm

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Replace spaces by signed zeroes

Postby kihaho » Wed May 07, 2008 8:22 pm

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
kihaho
 
Posts: 19
Joined: Tue May 06, 2008 11:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Replace spaces by signed zeroes

Postby CICS Guy » Wed May 07, 2008 8:30 pm

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...........
CICS Guy
 
Posts: 255
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

Re: Replace spaces by signed zeroes

Postby kihaho » Wed May 07, 2008 8:36 pm

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
kihaho
 
Posts: 19
Joined: Tue May 06, 2008 11:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Replace spaces by signed zeroes

Postby dick scherrer » Thu May 08, 2008 4:17 am

Hi Kihaho,

Good to hear that it is now working as needed.

Thanks for posting the update :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post