conversion of negative numbers

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
vardhan354
Participant
Posts: 76
Joined: Wed Jan 25, 2006 6:42 pm

conversion of negative numbers

Post by vardhan354 »

Hi folks,


i have a source column A of datatype numeric of length 6

and target is also numeric of length6

The logic need to be applied for this field

is when the source record value is -ve then it represents the age>80

with respect to that we need to add the Century for that value.

Please help me with any logic.

my understanding is first to convert numeric filed to DATE
then by writing logic on that date filed will work.

Thanks in advance.
ETL
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

You will probably find it easier leaving everything of data type numeric. All you need is a suitable If..Then..Else, and plain arithmetic.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jgreve
Premium Member
Premium Member
Posts: 107
Joined: Mon Sep 25, 2006 4:25 pm

Re: conversion of negative numbers

Post by jgreve »

Please explain your logic a little more.
"when the source record value is negative, then
it represents the age > 80."

Perhaps an example would help me.
Do you mean like this?

Code: Select all

A  = B
0 = 0
1 = 1
50 = 50
79 = 79
80 = 80
81 = not possible?
-1 = 81
-19 = 99
-20 = 100
vardhan354
Participant
Posts: 76
Joined: Wed Jan 25, 2006 6:42 pm

Re: conversion of negative numbers

Post by vardhan354 »

Thanks for u r response jgreve,

i will give a complete logic for that by the end of the day.


please help me.


Thanks in advance.
ETL
Post Reply