StringToDate function

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Mike3000
Participant
Posts: 24
Joined: Mon Mar 26, 2007 9:16 am

StringToDate function

Post by Mike3000 »

Job configuration:
SeqFile->Transf->SeqFile

DSLink6.stdate is "Varchar(6)" in input-tab and "Date"
in output-tab of Transformer

In Transformer i defined variable "v_stdate" as
StringToDate(Trim(DSLink6.stdate),"%yy-%mm-%dd")
to be mapped to output "Date"-format column

i can not compile it and DS var record is in a red colour?

Could you tell me please what's wrong with my syntax?
I already spent a while, trying different syntaxes.

Thanks
Edited by Mike3000
DSguru2B
Charter Member
Charter Member
Posts: 6854
Joined: Wed Feb 09, 2005 3:44 pm
Location: Houston, TX

Post by DSguru2B »

StringToDate() is a parallel job function and not a server job function. Use ICONV/OCONV to get your desired result. If your date is already in YY-MM-DD format and that is what you require then leave it as it is. Server jobs are not fussy about datatypes. You can directly map a varchar to a date field.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
Mike3000
Participant
Posts: 24
Joined: Mon Mar 26, 2007 9:16 am

Post by Mike3000 »

Thanks DSGuru2B, somehow i was sure that i can use it in Server Edition.
I'll use ICONV/OCONV
Edited by Mike3000
Post Reply