Create Fixed Flat file with hexadecimal values

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
suja.somu
Participant
Posts: 79
Joined: Thu Feb 07, 2013 10:51 pm

Create Fixed Flat file with hexadecimal values

Post 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.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Easiest would be a BASIC Transformer stage using Oconv() function specifying "MX0C" as the conversion.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
suja.somu
Participant
Posts: 79
Joined: Thu Feb 07, 2013 10:51 pm

Post 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?
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post 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,
- james wiles


All generalizations are false, including this one - Mark Twain.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post 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,
- james wiles


All generalizations are false, including this one - Mark Twain.
Post Reply