IsValid with date format
Moderators: chulett, rschirm, roy
IsValid with date format
I have a prblem with the function IsValid :
IsValid("date [%yyyy%mm%dd]", Ln_pour_controle.date_creation)
tell me this error :
APT_CombinedOperatorController,0: The schema type "date" does not take parameters "%yyyy%mm%dd"
could you tell me where is the syntax error
thank's a lot
IsValid("date [%yyyy%mm%dd]", Ln_pour_controle.date_creation)
tell me this error :
APT_CombinedOperatorController,0: The schema type "date" does not take parameters "%yyyy%mm%dd"
could you tell me where is the syntax error
thank's a lot
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Basically it is telling you that IsValid("date", Ln_pour_controle.date_creation) is legal but IsValid("date [%yyyy%mm%dd]", Ln_pour_controle.date_creation) is not.
That is, in the IsValid() function, the first argument must be a literal string that does not contain a formatting parameter.
That is, in the IsValid() function, the first argument must be a literal string that does not contain a formatting parameter.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Isvalid
thank's for your answer,ray.wurlod wrote:Basically it is telling you that IsValid("date", Ln_pour_controle.date_creation) is legal but IsValid("date [%yyyy%mm%dd]", Ln_pour_controle.date_creation) is n ...
When you go in the help manual, it's clearly written that you can put a format just after,..
when I use just IsValid("date",...) it's working, but if I put a caracter just after date for exemple : IsValid("dateAAAAA",...) it says " [ expected".
If I put IsValid("date [.....]",...), it says " date does not take parameters ... "
I know that in a modify I have to write toto:string = ["%yyyy%mm%dd"]string_from_date(my_date)
with " , but in my string, how to use the " ?
Do you have an other way to verify if a string is well AAAAMDD formatd ??
Thank's in advance for your answer
IsValid(date "%yyyy-%mm-%dd", ... don't work, it's waiting a string in first parameter,
if I put IsValid("date ["%yyyy%mm%dd"]",...) it's "red" because of the " in the string
In other langages, there's \" or "" to put the " caracter in a string,
If Ascential's engineer have put the fonction, that's that it normally works, no ?
thank's in advance for your answer,...
if I put IsValid("date ["%yyyy%mm%dd"]",...) it's "red" because of the " in the string
In other langages, there's \" or "" to put the " caracter in a string,
If Ascential's engineer have put the fonction, that's that it normally works, no ?
thank's in advance for your answer,...
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Resolved
Thank's a lot, it's working without warningbandish wrote:Hi,
May be you can use
IsValid('DATE',StringToDate(<Column Name>,"%yyyy%mm%dd"))
It will give output as 1 or 0 depending on if the date is valid or not for the provided format.
Thanks
Bandish
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Here 'tis
Short Description
-----------------
Reports whether test value complies with the rules for a particular data type
Long Description
----------------
Returns NULL if either argument is not assigned or if the data type argument is null or unknown.
Always returns 1 (true) if the test value argument is null, because null is valid for any data type.
No range checking is performed for Float, Real, Double or DFloat data types; it suffices that these are numeric.
Strings containing more than 38 numeric characterse are not considered to be numeric (see BASIC manual).
Supported data types are:
Date and time data may be in appropriate format for current locale or in ISO 8601 format.
===========================================================================================================
-----------------
Reports whether test value complies with the rules for a particular data type
Long Description
----------------
Returns NULL if either argument is not assigned or if the data type argument is null or unknown.
Always returns 1 (true) if the test value argument is null, because null is valid for any data type.
No range checking is performed for Float, Real, Double or DFloat data types; it suffices that these are numeric.
Strings containing more than 38 numeric characterse are not considered to be numeric (see BASIC manual).
Supported data types are:
Code: Select all
uint8
int8 tinyint
uint16
int16 smallint
uint32
int32 integer int
uint64
int64 bigint
char(n) string[n]
varchar(n) string[max=n]
decimal(p,n) numeric(p,n) number
float real
dfloat double
date
time
timestamp
===========================================================================================================
Code: Select all
FUNCTION IsValid(argTestValue, argDataType)
$COPYRIGHT "Copyright (c) 2002-2006, Ray Wurlod. All rights reserved."
$INCLUDE UNIVERSE.INCLUDE UVNLSLOC.H
$UNDEFINE TESTING
DEFFUN IsValid(TheTestValue, TheDataType) Calling "DSU.IsValid"
Equate RoutineName To "IsValid"
* Constants for range checking integer data types
Equate MinTinyInt To -2^7, MaxTinyInt To 2^7-1, MaxUInt8 To 2^8-1
Equate MinSmallInt To -2^15, MaxSmallInt To 2^15-1, MaxUInt16 To 2^16-1
Equate MinInteger To -2^31, MaxInteger To 2^31-1, MaxUInt32 To 2^32-1
Equate MinBigInt To -2^63, MaxBigInt To 2^63-1, MaxUInt64 To 2^64-1
* Pattern that all signed integers must match
Equate IntgerPattern To "1N0N" : @VM : "'-'1N0N" : @VM : "+'1N0N"
* Pattern that all timestamps must match: "YYYY-MM-DD HH:MM:SS" or "YYYY-MM-DD HH:MM:SS.s..."
Equate TimestampPattern To "4N'-'2N'-'2N' '2N':'2N':'2N" : @VM : "4N'-'2N'-'2N' '2N':'2N':'2N'.'1N0N"
* Decimal place designator (from NUMERIC locale if NLS enabled, otherwise "."
LInfo = LocaleInfo(UVLC$NUMERIC)
If LInfo = LCE$NO.LOCALES
Then
DecimalPlace = "."
End
Else
DecimalPlace = LInfo<2>
End
* Check that input arguments are both assigned and that data type argument is not null.
* Otherwise return immediately.
If UnAssigned(argTestValue) Or UnAssigned(argDataType) Or IsNull(argDataType)
Then
Call DSTransformError("Invalid argument(s).", RoutineName)
RETURN(@NULL)
End
* NULL is valid for any data type. Return immediately.
If IsNull(argTestValue)
Then
RETURN(@TRUE)
End
* Decompose the data type argument. Extract precision and scale where applicable.
ActualDataType = Upcase(Field(argDataType, "(", 1, 1))
DataTypeSpecs = Convert(" ", "", Field(argDataType[col2()+1,Len(argDataType)], ")", 1, 1))
Precision = Field(DataTypeSpecs, ",", 1, 1) + 0
Scale = Field(DataTypeSpecs, ",", 2, 1)
If UpCase(argDataType) = "CHAR"
Then
Precision = 1
End
If Left(ActualDataType,6) = "STRING"
Then
DataTypeSpecs = Field(Field(argDataType, "[", 2, 1), "]", 1, 1)
If UpCase(DataTypeSpecs[1,3]) = "MAX" Or ActualDataType = "STRING"
Then
ActualDataType = "VARCHAR"
End
Else
ActualDataType = "CHAR"
End
Precision = Oconv(DataTypeSpecs, "MCN") + 0
End
* Build list of supported data types in COMMON variable so that it is only built once.
COMMON /IsValid/ SupportedDataTypes
If SupportedDataTypes = 0
Then
SupportedDataTypes = ""
GoSub BuildSupportedDataTypesList
End
$IFDEF TESTING
SupportedDataTypes = ""
GoSub BuildSupportedDataTypesList
$ENDIF
Locate ActualDataType In SupportedDataTypes Setting PositionInList
Then
On PositionInList GoSub UInt8, Int8, Int8, UInt16, Int16, Int16, UInt32, Int32, Int32, Int32, UInt64, Int64, Int64, CharN, VarCharN, VarCharN, Decimal, Decimal, Decimal, Float, Float, Float, Float, Date, Time, Timestamp
End
Else
Ans = @NULL
Call DSTransformError("Unsupported data type.", RoutineName)
End
RETURN(Ans)
BuildSupportedDataTypesList:
SupportedDataTypes<-1> = "UINT8"
SupportedDataTypes<-1> = "INT8"
SupportedDataTypes<-1> = "TINYINT"
SupportedDataTypes<-1> = "UINT16"
SupportedDataTypes<-1> = "INT16"
SupportedDataTypes<-1> = "SMALLINT"
SupportedDataTypes<-1> = "UINT32"
SupportedDataTypes<-1> = "INT32"
SupportedDataTypes<-1> = "INT"
SupportedDataTypes<-1> = "INTEGER"
SupportedDataTypes<-1> = "UINT64"
SupportedDataTypes<-1> = "INT64"
SupportedDataTypes<-1> = "BIGINT"
SupportedDataTypes<-1> = "CHAR"
SupportedDataTypes<-1> = "VARCHAR"
SupportedDataTypes<-1> = "VARCHAR2"
SupportedDataTypes<-1> = "DECIMAL"
SupportedDataTypes<-1> = "NUMERIC"
SupportedDataTypes<-1> = "NUMBER"
SupportedDataTypes<-1> = "FLOAT"
SupportedDataTypes<-1> = "REAL"
SupportedDataTypes<-1> = "DFLOAT"
SupportedDataTypes<-1> = "DOUBLE"
SupportedDataTypes<-1> = "DATE"
SupportedDataTypes<-1> = "TIME"
SupportedDataTypes<-1> = "TIMESTAMP"
RETURN(0)
UInt8:
* Unsigned eight-bit integer
Ans = argTestValue Matches "1N0N" And Len(Oconv(argTestValue, "R0," : MaxUInt8))
RETURN(Ans)
Int8:
* Signed eight-bit integer
Ans = argTestValue Matches IntgerPattern And Len(Oconv(argTestValue, "R" : MinTinyInt : "," : MaxTinyInt))
RETURN(Ans)
UInt16:
* Unsigned 16-bit integer
Ans = argTestValue Matches "1N0N" And Len(Oconv(argTestValue, "R0," : MaxUInt16))
RETURN(Ans)
Int16:
* Signed 16-bit integer
Ans = argTestValue Matches IntgerPattern And Len(Oconv(argTestValue, "R" : MinSmallInt : "," : MaxSmallInt))
RETURN(Ans)
UInt32:
* Unsigned 32-bit integer
Ans = argTestValue Matches "1N0N" And Len(Oconv(argTestValue, "R0," : MaxUInt32))
RETURN(Ans)
Int32:
* Signed 32-bit integer
Ans = argTestValue Matches IntgerPattern And Len(Oconv(argTestValue, "R" : MinInteger : "," : MaxInteger))
RETURN(Ans)
UInt64:
* Unsigned 64-bit integer
Ans = argTestValue Matches "1N0N" And Len(Oconv(argTestValue, "R0," : MaxUInt64))
RETURN(Ans)
Int64:
* Signed 64-bit integer
Ans = argTestValue Matches IntgerPattern And Len(Oconv(argTestValue, "R" : MinBigInt : "," : MaxBigInt))
RETURN(Ans)
CharN:
* Character string of length N
Ans = (Len(argTestValue) = Precision)
RETURN(Ans)
VarCharN:
* Character string of length less than or equal to N
If Precision = 0
Then
Ans = @TRUE ; * string of arbitrary length; actual data type = "STRING"
End
Else
Ans = (Len(argTestValue) <= Precision)
End
RETURN(Ans)
Decimal:
* Decimal number with less than or equal to Precision significant digits (if Precision given) and exactly Scale decimal digits (if Scale given).
* Note: does not presently handle "scientific notation" such as 6.023E23
Ans = @FALSE
If Num(argTestValue)
Then
If Precision = 0
Then
Ans = @TRUE
End
Else
TestValue = argTestValue + 0 ; * remove leading and trailing zeroes, also an attempt to handle "scientific notation"
SignificantDigits = Convert("+-", "", TestValue) ; * remove sign
SignificantDigits = Len(Oconv(SignificantDigits, "MCN")) ; * count just the remaining digits
If SignificantDigits <= Precision
Then
DecimalDigits = Field(argTestValue, DecimalPlace, 2, 1)
If Len(Oconv(DecimalDigits, "MCN")) = Scale
Then
Ans = @TRUE
End
End
End
End
RETURN(Ans)
Float:
* Any numeric value can be a floating point number. See notes.
Ans = Num(argTestValue)
RETURN(Ans)
Date:
* Date in current locale format or in ISO 8601 format (YYYY-MM-DD)
Test1 = Iconv(argTestValue, "D") ; * current locale
Status1 = Status()
Test2 = Iconv(argTestValue, "DYMD")
Status2 = Status()
Ans = (Status1 = 0 Or Status2 = 0)
RETURN(Ans)
Time:
* Time in current locale format or in ISO 8601 format (HH:MM:SS) with optional fractional seconds
Test = Iconv(argTestValue, "MT")
Ans = (Status() = 0)
RETURN(Ans)
Timestamp:
Ans = @FALSE
If argTestValue Matches TimestampPattern
Then
DatePart = argTestValue[1,10]
TimePart = argTestValue[12,8]
Ans = IsValid(DatePart, "DATE") And IsValid(TimePart, "TIME")
End
RETURN(Ans)
RETURN(Ans)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Here 'tis
Short Description
-----------------
Reports whether test value complies with the rules for a particular data type
Long Description
----------------
Returns NULL if either argument is not assigned or if the data type argument is null or unknown.
Always returns 1 (true) if the test value argument is null, because null is valid for any data type.
No range checking is performed for Float, Real, Double or DFloat data types; it suffices that these are numeric.
Strings containing more than 38 numeric characterse are not considered to be numeric (see BASIC manual).
Supported data types are:
Date and time data may be in appropriate format for current locale or in ISO 8601 format.
===========================================================================================================
-----------------
Reports whether test value complies with the rules for a particular data type
Long Description
----------------
Returns NULL if either argument is not assigned or if the data type argument is null or unknown.
Always returns 1 (true) if the test value argument is null, because null is valid for any data type.
No range checking is performed for Float, Real, Double or DFloat data types; it suffices that these are numeric.
Strings containing more than 38 numeric characterse are not considered to be numeric (see BASIC manual).
Supported data types are:
Code: Select all
uint8
int8 tinyint
uint16
int16 smallint
uint32
int32 integer int
uint64
int64 bigint
char(n) string[n]
varchar(n) string[max=n]
decimal(p,n) numeric(p,n) number
float real
dfloat double
date
time
timestamp
===========================================================================================================
Code: Select all
FUNCTION IsValid(argTestValue, argDataType)
$COPYRIGHT "Copyright (c) 2002-2006, Ray Wurlod. All rights reserved."
$INCLUDE UNIVERSE.INCLUDE UVNLSLOC.H
$UNDEFINE TESTING
DEFFUN IsValid(TheTestValue, TheDataType) Calling "DSU.IsValid"
Equate RoutineName To "IsValid"
* Constants for range checking integer data types
Equate MinTinyInt To -2^7, MaxTinyInt To 2^7-1, MaxUInt8 To 2^8-1
Equate MinSmallInt To -2^15, MaxSmallInt To 2^15-1, MaxUInt16 To 2^16-1
Equate MinInteger To -2^31, MaxInteger To 2^31-1, MaxUInt32 To 2^32-1
Equate MinBigInt To -2^63, MaxBigInt To 2^63-1, MaxUInt64 To 2^64-1
* Pattern that all signed integers must match
Equate IntgerPattern To "1N0N" : @VM : "'-'1N0N" : @VM : "+'1N0N"
* Pattern that all timestamps must match: "YYYY-MM-DD HH:MM:SS" or "YYYY-MM-DD HH:MM:SS.s..."
Equate TimestampPattern To "4N'-'2N'-'2N' '2N':'2N':'2N" : @VM : "4N'-'2N'-'2N' '2N':'2N':'2N'.'1N0N"
* Decimal place designator (from NUMERIC locale if NLS enabled, otherwise "."
LInfo = LocaleInfo(UVLC$NUMERIC)
If LInfo = LCE$NO.LOCALES
Then
DecimalPlace = "."
End
Else
DecimalPlace = LInfo<2>
End
* Check that input arguments are both assigned and that data type argument is not null.
* Otherwise return immediately.
If UnAssigned(argTestValue) Or UnAssigned(argDataType) Or IsNull(argDataType)
Then
Call DSTransformError("Invalid argument(s).", RoutineName)
RETURN(@NULL)
End
* NULL is valid for any data type. Return immediately.
If IsNull(argTestValue)
Then
RETURN(@TRUE)
End
* Decompose the data type argument. Extract precision and scale where applicable.
ActualDataType = Upcase(Field(argDataType, "(", 1, 1))
DataTypeSpecs = Convert(" ", "", Field(argDataType[col2()+1,Len(argDataType)], ")", 1, 1))
Precision = Field(DataTypeSpecs, ",", 1, 1) + 0
Scale = Field(DataTypeSpecs, ",", 2, 1)
If UpCase(argDataType) = "CHAR"
Then
Precision = 1
End
If Left(ActualDataType,6) = "STRING"
Then
DataTypeSpecs = Field(Field(argDataType, "[", 2, 1), "]", 1, 1)
If UpCase(DataTypeSpecs[1,3]) = "MAX" Or ActualDataType = "STRING"
Then
ActualDataType = "VARCHAR"
End
Else
ActualDataType = "CHAR"
End
Precision = Oconv(DataTypeSpecs, "MCN") + 0
End
* Build list of supported data types in COMMON variable so that it is only built once.
COMMON /IsValid/ SupportedDataTypes
If SupportedDataTypes = 0
Then
SupportedDataTypes = ""
GoSub BuildSupportedDataTypesList
End
$IFDEF TESTING
SupportedDataTypes = ""
GoSub BuildSupportedDataTypesList
$ENDIF
Locate ActualDataType In SupportedDataTypes Setting PositionInList
Then
On PositionInList GoSub UInt8, Int8, Int8, UInt16, Int16, Int16, UInt32, Int32, Int32, Int32, UInt64, Int64, Int64, CharN, VarCharN, VarCharN, Decimal, Decimal, Decimal, Float, Float, Float, Float, Date, Time, Timestamp
End
Else
Ans = @NULL
Call DSTransformError("Unsupported data type.", RoutineName)
End
RETURN(Ans)
BuildSupportedDataTypesList:
SupportedDataTypes<-1> = "UINT8"
SupportedDataTypes<-1> = "INT8"
SupportedDataTypes<-1> = "TINYINT"
SupportedDataTypes<-1> = "UINT16"
SupportedDataTypes<-1> = "INT16"
SupportedDataTypes<-1> = "SMALLINT"
SupportedDataTypes<-1> = "UINT32"
SupportedDataTypes<-1> = "INT32"
SupportedDataTypes<-1> = "INT"
SupportedDataTypes<-1> = "INTEGER"
SupportedDataTypes<-1> = "UINT64"
SupportedDataTypes<-1> = "INT64"
SupportedDataTypes<-1> = "BIGINT"
SupportedDataTypes<-1> = "CHAR"
SupportedDataTypes<-1> = "VARCHAR"
SupportedDataTypes<-1> = "VARCHAR2"
SupportedDataTypes<-1> = "DECIMAL"
SupportedDataTypes<-1> = "NUMERIC"
SupportedDataTypes<-1> = "NUMBER"
SupportedDataTypes<-1> = "FLOAT"
SupportedDataTypes<-1> = "REAL"
SupportedDataTypes<-1> = "DFLOAT"
SupportedDataTypes<-1> = "DOUBLE"
SupportedDataTypes<-1> = "DATE"
SupportedDataTypes<-1> = "TIME"
SupportedDataTypes<-1> = "TIMESTAMP"
RETURN(0)
UInt8:
* Unsigned eight-bit integer
Ans = argTestValue Matches "1N0N" And Len(Oconv(argTestValue, "R0," : MaxUInt8))
RETURN(Ans)
Int8:
* Signed eight-bit integer
Ans = argTestValue Matches IntgerPattern And Len(Oconv(argTestValue, "R" : MinTinyInt : "," : MaxTinyInt))
RETURN(Ans)
UInt16:
* Unsigned 16-bit integer
Ans = argTestValue Matches "1N0N" And Len(Oconv(argTestValue, "R0," : MaxUInt16))
RETURN(Ans)
Int16:
* Signed 16-bit integer
Ans = argTestValue Matches IntgerPattern And Len(Oconv(argTestValue, "R" : MinSmallInt : "," : MaxSmallInt))
RETURN(Ans)
UInt32:
* Unsigned 32-bit integer
Ans = argTestValue Matches "1N0N" And Len(Oconv(argTestValue, "R0," : MaxUInt32))
RETURN(Ans)
Int32:
* Signed 32-bit integer
Ans = argTestValue Matches IntgerPattern And Len(Oconv(argTestValue, "R" : MinInteger : "," : MaxInteger))
RETURN(Ans)
UInt64:
* Unsigned 64-bit integer
Ans = argTestValue Matches "1N0N" And Len(Oconv(argTestValue, "R0," : MaxUInt64))
RETURN(Ans)
Int64:
* Signed 64-bit integer
Ans = argTestValue Matches IntgerPattern And Len(Oconv(argTestValue, "R" : MinBigInt : "," : MaxBigInt))
RETURN(Ans)
CharN:
* Character string of length N
Ans = (Len(argTestValue) = Precision)
RETURN(Ans)
VarCharN:
* Character string of length less than or equal to N
If Precision = 0
Then
Ans = @TRUE ; * string of arbitrary length; actual data type = "STRING"
End
Else
Ans = (Len(argTestValue) <= Precision)
End
RETURN(Ans)
Decimal:
* Decimal number with less than or equal to Precision significant digits (if Precision given) and exactly Scale decimal digits (if Scale given).
* Note: does not presently handle "scientific notation" such as 6.023E23
Ans = @FALSE
If Num(argTestValue)
Then
If Precision = 0
Then
Ans = @TRUE
End
Else
TestValue = argTestValue + 0 ; * remove leading and trailing zeroes, also an attempt to handle "scientific notation"
SignificantDigits = Convert("+-", "", TestValue) ; * remove sign
SignificantDigits = Len(Oconv(SignificantDigits, "MCN")) ; * count just the remaining digits
If SignificantDigits <= Precision
Then
DecimalDigits = Field(argTestValue, DecimalPlace, 2, 1)
If Len(Oconv(DecimalDigits, "MCN")) = Scale
Then
Ans = @TRUE
End
End
End
End
RETURN(Ans)
Float:
* Any numeric value can be a floating point number. See notes.
Ans = Num(argTestValue)
RETURN(Ans)
Date:
* Date in current locale format or in ISO 8601 format (YYYY-MM-DD)
Test1 = Iconv(argTestValue, "D") ; * current locale
Status1 = Status()
Test2 = Iconv(argTestValue, "DYMD")
Status2 = Status()
Ans = (Status1 = 0 Or Status2 = 0)
RETURN(Ans)
Time:
* Time in current locale format or in ISO 8601 format (HH:MM:SS) with optional fractional seconds
Test = Iconv(argTestValue, "MT")
Ans = (Status() = 0)
RETURN(Ans)
Timestamp:
Ans = @FALSE
If argTestValue Matches TimestampPattern
Then
DatePart = argTestValue[1,10]
TimePart = argTestValue[12,8]
Ans = IsValid(DatePart, "DATE") And IsValid(TimePart, "TIME")
End
RETURN(Ans)
RETURN(Ans)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Date Conversion warning
Hi,
I used the IsValid() function in the same way as descibed above.
IsValid("date [%yyyy%mm%dd]", Ln_pour_controle.date_creation)
But the problem which I m facing with this is that whenver a Invalid date passes through the date conversion function it throws a warning, which I don't want. Is their any way, so that warning dosen't appear at all?
Or is their any other way to validate the date?
Thanks
I used the IsValid() function in the same way as descibed above.
IsValid("date [%yyyy%mm%dd]", Ln_pour_controle.date_creation)
But the problem which I m facing with this is that whenver a Invalid date passes through the date conversion function it throws a warning, which I don't want. Is their any way, so that warning dosen't appear at all?
Or is their any other way to validate the date?
Thanks
Regards,
Novneet Jain
Novneet Jain
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Welcome aboard. :D
If you test for validity before applying the conversion function, and only apply the conversion function to valid dates, then the warnings will not appear.
You have to specify, and then design, what happens to rows in which the date is not a valid format.
If you test for validity before applying the conversion function, and only apply the conversion function to valid dates, then the warnings will not appear.
You have to specify, and then design, what happens to rows in which the date is not a valid format.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.