Transformer Logic?

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
pkll
Participant
Posts: 73
Joined: Thu Oct 25, 2012 9:45 pm

Transformer Logic?

Post by pkll »

Hi All,

I have some records in EFF_DATE column.

In this i have some NULL values and '0001-01-01' and '1559-01-01' records and i have some after 1990's records.

if date > 1800 i need to pass same input date value. if date is NULL value i need to pass Null value only.when date is '0001-01-01' and '1559-01-01' i need to pass hard code value('1799-01-01')


I tried as below

if trim((YearFromDate(input.EFF_DATE)))='' then '1600' else (YearFromDate(input.EFF_DATE))------STG1

If STG > '1800' Then input.EFF_DATE else '1799-01-01'----------STG2

In this NULL value is also converting '1799-01-01'.

But when NULL values are coming i need to populate NULL values only.


Could you please help me the above?

Thanks For Advance help!!!!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Then check for NULL explicitly and handle it explicitly in addition to your other checks / transforms.
-craig

"You can never have too many knives" -- Logan Nine Fingers
yugee
Participant
Posts: 34
Joined: Fri Feb 04, 2011 5:54 pm

Post by yugee »

replace your below condition:

If input.EFF_DATE='' OR IsNull(input.EFF_DATE) Then
input.EFF_DATE
Else
If STG > '1800' Then input.EFF_DATE else '1799-01-01'----------STG2
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Or explicitly pass NULL for those first two conditions.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply