datastage

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
bharatmajeti
Participant
Posts: 13
Joined: Mon Feb 18, 2008 7:28 am

datastage

Post by bharatmajeti »

Hi all,
my source is db2 and target is flat file,loading the data using teansformer stage.here i need to convert the RGB value into hexadecimal value.please let me know,how can i convert using transformer stage.please tell me briefly.
Nothing but something
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Transformer doesn't currently have an integer<-->hex conversion function builtin.

I don't know what your RGB value is, but if it's a column in the data you've extracted from DB2, use a Column Export stage to convert that column from Integer (assuming integer) to Char or VarChar and in the column metadata (input tab, double-click on the column number), select Integer type, then either C_format or Out_format and place an appropriate C-style format specifier. In this case, it will be %x or %X, or some variation of those.

[EDIT]: If all you need to do is to write the "RGB" value out as a hex vlaue in the flat file, use the same options in the sequential file stage as I described for the Column Export stage, then you don't need Column Export.[/EDIT]

The wikipedia article on printf has a list of the format specifiers for reference.

Regards,
- james wiles


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