Page 1 of 1
How to generate Hex(15) in Seq File
Posted: Sat Sep 29, 2007 3:08 pm
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.
Posted: Sat Sep 29, 2007 3:17 pm
by ArndW
Hello and welcome to DSXchange.
The transform stage will let you use the CHAR(15) function to generate this character.
Posted: Sat Sep 29, 2007 3:33 pm
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.
Posted: Sat Sep 29, 2007 6:00 pm
by ArndW
NAK is char 15, not char 21. I don't know where you picked up the 21 from.
Posted: Sun Sep 30, 2007 2:25 am
by ray.wurlod
From the original post, where the question was how to generate Hex 15.
Posted: Mon Oct 01, 2007 4:16 pm
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.
Posted: Mon Oct 01, 2007 4:55 pm
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.
Posted: Mon Oct 01, 2007 6:20 pm
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.