Page 1 of 1

Convert Binary to Decimal in PX 8.0.1

Posted: Tue Nov 10, 2009 3:03 am
by satishm
Hi, Can anyone please help me to convert the input Binary column to be converted to Decimal.

Input string is "08 16 O 00 0f 08 16 O f5 f0 f1 f0 f0 e8 e8 f0 f0 f1 f1 d5 @ @ 07 85 14 8f 00 0f 00 00 00 0f 00 00 00 03 8c 01 d 09 / f0 f2 f0 f2"

Output should be Decimal value.

Can please anyone help me on this?
This is urgent.

Thanks in Advance.

Posted: Tue Nov 10, 2009 3:14 am
by ArndW
The issue might be urgent for you, but not to DSXchange. Ray puts it into a much nicer wording than I do.

"Binary" just means non-ascii unless you specify what format it is in. Without knowing what format it is, no conversion is possible. But my first guess is that you are looking at more than one number considering the length of the string.

Posted: Tue Nov 10, 2009 3:27 am
by satishm
I appologise for words mismatch from my side, i must have typed in "Issue is Urgent for me".

This is the Filler column from CFF which was stored into dataset as a binary column in our Cycle 1 jobs, now in Cycle 2 we are using this dataset and extracting the information stored in Filler column, this is a Hex Data and we tried many routines but it just throws error "Unable to convert Raw to String."

Please do help me.

Thanks N Regards.

Posted: Tue Nov 10, 2009 3:42 am
by anand_dafaria
Hi,
I think you need to put the data from cycle 1 jobs into a binary file instead of a dataset and then read that file using CFF once again by giving the correct layout of the filler column.


Thanks

Posted: Tue Nov 10, 2009 4:04 am
by ray.wurlod
What size decimal?

There is information in the manuals about how decimal numbers are stored, but the number of bytes depends on both the precision and the scale.

Posted: Tue Nov 10, 2009 4:27 am
by satishm
Hi, We want to use only first 18 digits from the filed.
Like the Field Name is Filler1 with size 120.
But we will be using Filler1[1,18] and store it in Decimal of (20,2).


Thanks.

Re: Convert Binary to Decimal in PX 8.0.1

Posted: Tue Nov 10, 2009 3:09 pm
by Kryt0n
satishm wrote:Hi, Can anyone please help me to convert the input Binary column to be converted to Decimal.

Input string is "08 16 O 00 0f 08 16 O f5 f0 f1 f0 f0 e8 e8 f0 f0 f1 f1 d5 @ @ 07 85 14 8f 00 0f 00 00 00 0f 00 00 00 03 8c 01 d 09 / f0 f2 f0 f2"

Output should be Decimal value.

Can please anyone help me on this?
This is urgent.

Thanks in Advance.
I can't see you getting an 18 digit decimal out of that input, I can't even see an 18 digit packed decimal in it... or do you mean literally each character in to decimal equivalent?