Page 1 of 1

OCONV-MCP replacement for PX

Posted: Tue Oct 10, 2006 12:25 pm
by gsherry1
Hello Forum,

Is there a general string cleansing function in parallel job like OCONV-MCP to remove all non-printable characters? The only way I can figure to do this is to explicitly list all the characters you wish to translate in a convert function call.

Any other suggestions?

Thanks,

Greg

Posted: Tue Oct 10, 2006 12:52 pm
by ArndW
No builtin PX equivalent to the "MCP" code of Iconv/Oconv. :(

Posted: Tue Oct 10, 2006 2:31 pm
by ray.wurlod
BASIC Transformer stage? This will allow you to use Oconv() admittedly with a throughput penalty.

Posted: Wed Oct 11, 2006 3:04 pm
by mhester
Greg,

Don't know if you found a decent solution to your issue, but you could use the following unix command -

Code: Select all

tr -cd '\11\12\40-\176' < $INPUT_FILE > $OUTPUT_FILE
This will strip all non-printable characters from a string and I would think it would be much more efficient than throttling down to a sequential flow using the BASIC transformer.

I created a wrapper which invoked this from a stream and it works as advertised.

Try not to develop in terms of mixing server and parallel processes (unless absolutely necessary), but to separate these processes.

Posted: Wed Oct 11, 2006 3:17 pm
by ray.wurlod
:idea: That approach would probably also work in an External Filter stage.

Posted: Thu Oct 12, 2006 10:52 am
by mhester
Ray,
That approach would probably also work in an External Filter stage.
You are correct, but it's a bit tougher.

Posted: Thu Oct 12, 2006 10:54 am
by DSguru2B
Yea, but isnt this dude sitting on windows? :roll:

Posted: Thu Oct 12, 2006 2:29 pm
by ray.wurlod
Duzn't matta!

Parallel jobs on Windows actually run on MKS Toolkit (a UNIX emulator). So you have all the UNIX shell functionality you need. The tr command is definitely available.