Validating Date

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

G SHIVARANJANI
Participant
Posts: 137
Joined: Sun Jan 07, 2007 11:17 pm
Location: VISAKHAPATNAM

Post by G SHIVARANJANI »

I have given this way

IsValid('date',StringToDate(INP_02.S_deed_date,"%mm/%dd/%yyyy")) or IsValid('date',StringToDate(INP_02.S_deed_date,"%m/%dd/%yyyy")) or IsValid('date',StringToDate(INP_02.S_deed_date,"%mm/%d/%yyyy")) or IsValid('date',StringToDate(INP_02.S_deed_date,"%m/%d/%yyyy"))

its giving error as :

APT_CombinedOperatorController,0: Caught exception from runLocally(): APT_ParseError: Parsing parameters "%m/%dd/%yyyy" for conversion "date=date_from_string[%yyyy-%mm-%dd](string)": APT_Conversion_String_Date: Invalid Format [%m/%dd/%yyyy] used for string_from_date type conversion.


ray.wurlod wrote:Why not use three IsValid() functions (with different date format strings) connected by OR ? ...
Shivaranjani
G SHIVARANJANI
Participant
Posts: 137
Joined: Sun Jan 07, 2007 11:17 pm
Location: VISAKHAPATNAM

Post by G SHIVARANJANI »

I have given this way:

IsValid('date',StringToDate(INP_02.S_deed_date,"%mm/%dd/%yyyy")) or IsValid('date',StringToDate(INP_02.S_deed_date,"%m/%dd/%yyyy")) or IsValid('date',StringToDate(INP_02.S_deed_date,"%mm/%d/%yyyy")) or IsValid('date',StringToDate(INP_02.S_deed_date,"%m/%d/%yyyy"))

But its giving error:

APT_CombinedOperatorController,0: Caught exception from runLocally(): APT_ParseError: Parsing parameters "%m/%dd/%yyyy" for conversion "date=date_from_string[%yyyy-%mm-%dd](string)": APT_Conversion_String_Date: Invalid Format [%m/%dd/%yyyy] used for string_from_date type conversion.
Shivaranjani
mads_a
Participant
Posts: 9
Joined: Sun May 04, 2008 11:32 pm

Date validation

Post by mads_a »

does both the 'date' values that need to be passed in the below given function same? If yes, is it the input column name?

JoshGeorge wrote:Use IsValid() function.
If your input date is not in date format you might want to convert it and use - IsValid('date',StringToDate(InputLink.Date,"%yyyy%mm%dd"))
Madhavi Ancha
mads_a
Participant
Posts: 9
Joined: Sun May 04, 2008 11:32 pm

Date validation

Post by mads_a »

does both the 'date' values that need to be passed in the below given function same? If yes, is it the input column name?

JoshGeorge wrote:Use IsValid() function.
If your input date is not in date format you might want to convert it and use - IsValid('date',StringToDate(InputLink.Date,"%yyyy%mm%dd"))
Madhavi Ancha
Post Reply