Originally posted by: paul.brett
It is important to understand how CTEXT() and CPACKAGE() are working.
=CTEXT(In1,"NATIVE")
....does not mean convert the input to NATIVE. What it means is.... assume that the input is native already (ignore the current object encoding completely).
So, in a RUN() function on the z/OS platform, where the content needs to pretend to be NATIVE (otherwise it will be converted to EBCDIC) you might use it thus:
=RUN("SubMap.mvs",ECHOIN(1,CTEXT(In1,"NATIVE"))
...where your top level map input is UTF-8 and your sub map is also expecting UTF-8.
Now this is where it gets interesting. If you place this rule in an output object rule cell that is defined as anything other than NATIVE, you also need to take account of the fact that the result will be assumed to be NATIVE, and may be converted, and thus you might need to wrap the entire rule in another CTEXT() just to ensure that it is not converted:
=CTEXT(RUN("SubMap.mvs",ECHOIN(1,CTEXT(In1,"NATIVE")),"UTF-8")
In summary, the rule above is saying, .... take the input, pretend it is already NATIVE (don't do any conversions) and send it to the sub map. Take the result, pretend it is already UTF-8 (don't convert it) and place it directly on the resulting object.
I hope this makes sense.
Thank-you.
Paul.
Follow me on Twitter
#DataExchange#IBM-Websphere-Transformation-Extender#IBMSterlingTransformationExtender