Page 1 of 2

How to get rid of the garbage characters.

PostPosted: Thu May 15, 2008 9:08 pm
by kihaho
Hi,
I have a file that contains garbage characters which is causing a hang in a batch job.
When I turn HEX on, it showed up as – CC
02
I believe it’s a carriage return.
What can I do to prevent this programmatically in the future.?
The field is defined as: PICX(60).

Thank you for your assistance.

Re: How to get rid of the garbage characters.

PostPosted: Thu May 15, 2008 9:42 pm
by CICS Guy
kihaho wrote:I have a file that contains garbage characters which is causing a hang in a batch job.
When I turn HEX on, it showed up as – CC
02
I believe it’s a carriage return.
What can I do to prevent this programmatically in the future.?
The field is defined as: PICX(60).
You mean that there are two bytes of X'C0C2'? Or one byte of X'02'?
Multiple times? In the same location?

More info is needed, but why not prevent the program outputting the data to not output the 'garbage' in the first place?
Or, after reading the record, eliminate the garbage before processing it?

Re: How to get rid of the garbage characters.

PostPosted: Fri May 16, 2008 10:08 pm
by kihaho
Hi CICS guy,
Thank you for the reply.
Here is my answer to your question.

You mean that there are two bytes of X'C0C2'? Or one byte of X'02'?
Multiple times? In the same location?

It's x'C0C2'.(2 bytes)

More info is needed, but why not prevent the program outputting the data to not output the 'garbage' in the first place?
Or, after reading the record, eliminate the garbage before processing it?CICS Guy

I'd like to know how to eliminate the garbage characters after reading the record, before processing it, please.
Thank you!!!
Posts: 218
Joined: Tue Jun 19, 2007 5:38 pm
Private message

Re: How to get rid of the garbage characters.

PostPosted: Sat May 17, 2008 12:40 am
by dick scherrer
Hello,

First, you have to identify all of the possible "garbage" characters.

Then, in your code (after the read and before usng the data) INSPECT the input data converting the "garbage" to whatever you want to use instead.

Re: How to get rid of the garbage characters.

PostPosted: Sat May 17, 2008 2:31 am
by CICS Guy
kihaho wrote:I'd like to know how to eliminate the garbage characters after reading the record, before processing it,
Again, do they appear multiple times? In the same location? Do you want to replace them with any particular value or have them 'squeezed' out of the record with trailing characters 'slid' forward?

Re: How to get rid of the garbage characters.

PostPosted: Tue May 20, 2008 6:48 pm
by kihaho
Hi Dick and CICS guy,
Thank you so much for your advice.
To answer your question, the value of the garbage character is always the same(x'C0C2').
But the location of this item changes all the time. The reason is that it’s PIC X(70) free form field.
People enter an accident description, so the length of the description differs every time. Therefore, the location of the garbage characters is somewhere in the 70bytes field and fluctuates.

As Dick suggested, I am going to put the Inspect statement after the record is read and before it’s processed:

Inspect Accident-description replacing all X’C0C2’ by spaces.

Is this right?
Thank you so much again!!

Re: How to get rid of the garbage characters.

PostPosted: Tue May 20, 2008 7:13 pm
by CICS Guy
kihaho wrote:Inspect Accident-description replacing all X’C0C2’ by spaces.
Is this right?
Looks good....
INSPECT statement

Re: How to get rid of the garbage characters.

PostPosted: Tue May 20, 2008 7:28 pm
by kihaho
Thank you again, so much!!!
You guys always deliver good!!

Re: How to get rid of the garbage characters.

PostPosted: Wed May 21, 2008 12:02 am
by dick scherrer
You're welcome :)

Is the INSPECT now working for you?

d

Re: How to get rid of the garbage characters.

PostPosted: Tue Jul 08, 2008 7:18 pm
by kihaho
Sorry for the delay on my reply.
Yes, the "inspect" is working beautifully!
Thank you again!!!