Page 1 of 1

Unsigned BigInt Out_format,right justify (write to seq file)

Posted: Mon Jul 02, 2007 8:21 am
by ivannavi
Been trying the whole day. (things like %llu, %Lu, %20u etc...) No luck. It always ends up left justified. And it doesn't make any difference if I don't specify the Out_format at all. :!: :?:

Posted: Mon Jul 02, 2007 9:25 am
by ray.wurlod
What are you trying to accomplish? These samples are strings, not BigInt. Therefore they will be left-justified. Please provide more detail of your job design, and any transformation expressions you may be using.

Posted: Mon Jul 02, 2007 9:59 am
by ivannavi
I'm trying to write an unsigned BigInt column to a sequential file (fixed width)
The column comes out from a Modify stage where it is converted from decimal(38,0) (I know, possible range limitation) to uint64 using "uint64_from_decimal". I have also tried implicit conversion inside a transformer.
If I change it to an ordinary integer (unsigned 32 bit) it works fine with "%10u" format specified. And it comes out right justified. It's only that this type is too small. So I need uint64.
What do you mean by "These samples are strings"? :?

Posted: Mon Jul 02, 2007 3:33 pm
by ray.wurlod
You did not specify that they were format strings, so I had to assume they were data.

Posted: Tue Jul 03, 2007 8:31 am
by ivannavi
Wrote a simple "hello world" in c. It behaves the same. So now I know this s a c language issue. Posted a question in comp.lang.c newsgroup.

Posted: Wed Jul 04, 2007 3:53 am
by ivannavi
The right format is "%20llu". Thanks to people at comp.lang.c