How to generate Hex(15) in Seq File

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
ajsingh
Participant
Posts: 6
Joined: Sat Sep 29, 2007 2:35 pm

How to generate Hex(15) in Seq File

Post by ajsingh »

Hi,
I need to populate Hex(15) character in file.

ASCII Value for this is -21
Char Value is -NAK
CTRL-char Value - CTRL-U
Expecting comments from you guys.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Hello and welcome to DSXchange.

The transform stage will let you use the CHAR(15) function to generate this character.
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You can use the function Char(21) to generate this value.

The argument to the Char() function must be a decimal number.

Tip: If you are going to use this a lot, initialize a stage variable (in a Transformer stage) with this function, and do not provide a derivation for that stage variable. This way the function need only to be evaluated once for the entire job run.
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 »

NAK is char 15, not char 21. I don't know where you picked up the 21 from.
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

From the original post, where the question was how to generate Hex 15.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
ajsingh
Participant
Posts: 6
Joined: Sat Sep 29, 2007 2:35 pm

Post by ajsingh »

Hi,
Its not helping..
When i open the file with Hex Editor corresponding character i generated using the CHAR(15)/CHAR(21) is comming to equivalent Hex Number 1A.
Any other thought on this.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

I would re-check your hex editor output. What happens if you output char(32)? That should show up as a space.
Perhaps you could try a very simple job, writing just that one character value to a file and make 100% sure that you are getting what you expect.
ajsingh
Participant
Posts: 6
Joined: Sat Sep 29, 2007 2:35 pm

Post by ajsingh »

Thanks ArndW and ray for your suugestions.
I am able to do now using CHAR(21),initially i also tried CAHR(21) & CHAR(15) but character it generates looks similar until you not open it in Hex Editor.
Solution-use CHAR(DECIMAL of the HEX).
Eg :For HEX(15) use CHAR(21),where 21 is DECIAML value for 15.
Post Reply