Reading Unsigned Packed Decimals.

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
sanjumsm
Premium Member
Premium Member
Posts: 64
Joined: Tue Oct 17, 2006 11:29 pm
Location: Toronto

Reading Unsigned Packed Decimals.

Post by sanjumsm »

I have senario where i have to read the Unsigned Packed Decimal.
I am using the sequential file stage to read the binary files.
Its value is
22334

and its HEX Value is
0234
023F

If any signed value come in the input file then it should be treated as Null.
Like

0234
023C OR

0234
023D.

I am able to read all these value from the source file.
Can we identify the unsigned decimal value at the time of reading in the sequential file.?
Or after reading the signed value can we seperate in the transformer. ?

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

Post by ray.wurlod »

You can mask the final byte with the BitAnd() function.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
arjun_004
Participant
Posts: 12
Joined: Wed Feb 07, 2007 2:10 am
Location: Mumbai
Contact:

Post by arjun_004 »

ray.wurlod wrote:You can mask the final byte with the BitAnd() function. ...
Hi Ray,

BitAnd() will compare the actual value in the input field.

1214
000F AND

1214
000C Are same becouse the have the same value.
Unsigned and Positve number have the same value.

I need to identify if any signed number comes in the Unsigned decimal.
field.

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

Post by ray.wurlod »

There are only certain rightmost nybbles that you can get for a signed packed decimal number. That's why I suggested using BitAnd() function - to identify whether these are present.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply