Page 1 of 1

how to validate date function in datastage?

Posted: Mon Aug 30, 2010 3:36 am
by balaya.ds
how to implement the below rule in Datastage?

i have a column "TransDate" the datatype is char and format is yyyymmdd

yyyy should be start with "20"

mm shd be value 01 through 12.

Posted: Mon Aug 30, 2010 3:46 am
by swathi Singamareddygari
Try using below logic

StgVardate=TransDate[1,4]:'-':TransDate[5,2]:'-':TransDate[7,2]

In another stage varible give the derivation like this

If StgVardate[1,2]='20' And IsValid('date',StgVardate) Then 'Valid' Else 'Invalid'

Re: how to validate date function in datastage?

Posted: Mon Aug 30, 2010 6:13 am
by HariK
balaya.ds wrote:how to implement the below rule in Datastage?

i have a column "TransDate" the datatype is char and format is yyyymmdd

yyyy should be start with "20"

mm shd be value 01 through 12.
what is your source?
If it is a database use database function to convert into date and check if the date is greater than 31-dec-1999
If sequential file Swathi's reply will help.