how to validate date function in datastage?

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
balaya.ds
Participant
Posts: 27
Joined: Fri Dec 25, 2009 10:50 pm

how to validate date function in datastage?

Post 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.
Sudheer
swathi Singamareddygari
Participant
Posts: 48
Joined: Fri Feb 29, 2008 1:09 am
Location: Bangalore

Post 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'
Thanks&Regards
S.Swathi
HariK
Participant
Posts: 68
Joined: Thu May 17, 2007 1:50 am

Re: how to validate date function in datastage?

Post 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.
Post Reply