Page 1 of 1

Create Fixed Flat file with hexadecimal values

Posted: Wed Feb 20, 2013 5:52 pm
by suja.somu
I have requirement to create a fixed flat file with hexadecimal representation only for few of the columns.
Is that possible with sequential file stage, if so could you please tell me the properties to set to acheive this ?. If not what stage I should use to acheive this?


Please help, if anyone has faced this situation before.

Posted: Wed Feb 20, 2013 7:34 pm
by ray.wurlod
Easiest would be a BASIC Transformer stage using Oconv() function specifying "MX0C" as the conversion.

Posted: Wed Feb 20, 2013 10:11 pm
by suja.somu
Thanks Ray for the answer.


Will there be an impact in the performance for using BASIC transformer in PARALLEL Job(I use 2 node config ). I will be processing more than 1 million records. Is there any other workaround to handle through functions in PX job?

Posted: Wed Feb 20, 2013 11:12 pm
by jwiles
In the sequential file stage, use the Out_format or C_format options for the column(s) you wish to output in hex format, providing an appropriate C-style format string. Here's a list if you're not familiar with them.

I would recommend either %x or %X to begin with, and you can adjust them from there to get the exact format you like.

Regards,

Posted: Wed Feb 20, 2013 11:19 pm
by ray.wurlod
Assuming you're in an SMP architecture the BASIC Transformer stage will execute in parallel.

James's suggestion of using a %x mask is also worth considering. By that means you can allot multiple readers per node.

Posted: Thu Feb 21, 2013 9:23 am
by jwiles
Just to help avoid confusion for the OP: my suggestion is implemented in the target sequential file stage, where the multiple readers per node option is not available (it's active only when seqfile is used as a source).

Regards,