Thursday, July 11, 2013

Is Modify Stage can be a alternate for Transformer



The Modify stage is a processing stage. It can have a single input link and
a single output link. It can also be used to modify schema, Keep or Drop the input columns.If you are using transformer just to drop or change schema of columns then it is better we use modify stage.

Below is the syntax of each of the operation possible in modify stage and below mentioned syntax can be used in specification box of modify stage..

'keep field1, field2, ... fieldn; '
'drop field1, field2, ... fieldn;' 

 ‘newField1=oldField1; newField2=oldField2;...newFieldn=oldFieldn;’

a_1 = a
Date field conversions:
dateField = date_from_days_since[date](int32Field)
dateField = date_from_julian_day(uint32Field)
dateField = date_from_string[date_format | date_uformat] (stringField)
dateField = date_from_timestamp(tsField
int8Field = month_day_from_date(dateField)
int8Field = weekday_from_date[originDay](dateField)
int16Field = year_day_from_date(dateField)
int32Field = days_since_from_date[source_date]
uint32Field = julian_day_from_date(dateField)
int8Field = month_from_date(dateField)
dateField = next_weekday_from_date[day](dateField)
dateField= previous_weekday_from_date[day]
stringField = string_from_date [date_format | ufornat] (dateField)
tsField = timestamp_from_date[time](dateField)
int16Field = year_from_date(dateField)
int8Field=year_week_from_date(dateField)

Decimal Field Conversions:
decimal from decimal decimalField = decimal_from_decimal[r_type](decimalField)
dfloat from dfloat dfloatField = mantissa_from_dfloat(dfloatField)
int32 from decimal int32Field = int32_from_decimal[r_type, fix_zero](decimalField)
int64 from decimal int64Field = int64_from_decimal[r_type, fix_zero](decimalField)
string from decimal stringField = string_from_decimal[fix_zero][suppress_zero](decimalField)
uint64 from decimal uint64Field = uint64_from_decimal[r_type, fix_zero](decimalField)

string Conversions:

hue:string[10] = string_trim['Z', end, begin](color)
stringField=substring(string, starting_position, length)
decimalField = decimal_from_string(stringField) Converts strings to decimals.
stringField = string_from_decimal[fix_zero] [suppress_zero] (decimalField) Converts decimals to strings
dateField = date_from_string [date_format | date_uformat] (stringField)
stringField = string_from_date [date_format | date_uformat] (dateField)
int32Field=string_length(stringField)stringField=lowercase_string (stringField)
stringField=uppercase_string (stringField)
stringField = string_from_time [time_format | time_uformat ] (timeField)
int8Field = hours_from_time(timeField) hours from time
int32Field = microseconds_from_time(timeField) microseconds from time
int8Field = minutes_from_time(timeField) minutes from time
dfloatField = seconds_from_time(timeField) seconds from time
dfloatField = midnight_seconds_from_time(timeField) seconds-from-midnight from time
stringField = string_from_time [time_format | time_uformat] (timeField)


0 comments:

 

Datastage Doctrina Copyright © 2011 -- Template created by O Pregador -- Powered by Blogger

Receive all updates, tips and tricks via Facebook. Just Click the Like Button Below