String Constants in Px transform stages

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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

String Constants in Px transform stages

Post by ArndW »

I would like to assign the value 0x3000 (Unicode/NLS) to a VARCHAR2 column as a constant expression in a Paralle transform stage. I can't for the life of me get this working; and haven't found reference in the docs on how to specify this string. I thought I had seen something here but didn't have any success using the search facility so perhaps someone can assist me.

Thanks...
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I think this is the post to which you were referring.

If you don't mind BASIC expressions, there's always

Code: Select all

UniChar(Iconv(3000, 'MX'))
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

I wonders what "MX" stands for. Mex? "A hex on your mex!"
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Masked hexadecimal. There's also "MO" (octal) and "MB" (binary). They're all in the online help - drill down from Iconv or Oconv topics.

You can also use "MCXD" (masked character hex to decimal) and "MCDX" (masked character decimal to hex).

They never ask this kind of stuff at trivia nights! :twisted:
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Ray,

I'm staying in a Px transform so I can't use a Basic function; I have a fixed text to input so I am looking for a way in Px to specify a hex value for a string; i.e. like '0x3000' (except that doesn't work :roll: )
T42
Participant
Posts: 499
Joined: Thu Nov 11, 2004 6:45 pm

Post by T42 »

You got mail.

Also, here's the skinny of what I did:

[row generator] -> [transform] -> [peek]

In Row Generator, provide a single field of a VarChar(whatever), and provide the hex values on the "Edit Column Meta Data" (Columns tab, double click on #1).

In Transform, output the regular field (as Varchar(whatever), and another field with the following value: "0x" : [input field]. This field have to be an integer.

Peek stage, regular stuff.

Output:

Peek_2,0: output:254 dummy:0000FE
Peek_2,0: output:35 dummy:0023
Peek_2,0: output:100 dummy:0064

This works with DataStage 7.1r2.
Post Reply