Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
I'm going to guess that your "input" is 'KIRAN-CSC ' (note the ending space).
One way to do this is to redefine the original 10-byte field as an array of 10 single-bytes.
Then define a second array of 10 single-bytes.
For each new value:
Initialize the second array to 0000000000.
Set the index or a subscript to the beginning of each array.
If the character in the input is a '-' or a space,
. . skip that byte and increment the input array position.
Otherwise, move the input "keeper" character to the output array and
. . increment the position in both arrays.
Repeat until you've parsed the entire input field.
The "output" will now contain the non'-' values from the "input" and will have zeros filling the unused positions on the right side. The value in the output area will be 'KIRANCSC00'. Note this is not the same as the posted result - the posted result will not fit in a PIC X(10) field.
If you want exactly 3 zeros to follow the result value, you will have to code slightly differently.