string to date conversion

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
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

string to date conversion

Post by kollurianu »

I have input value in the file as varchar(10) as yyyymmdd /yymmdd , I got to insert into the oracle database as date field.

Before writing to table I am just converting the string to date format and writing to a file for testing purposes which is not working and job is aborting.Following the function used for conversion.

StringToDate(DSLink92.PROCESS_DATE, "%yyyy-%mm-%dd%" )

Any inputs greatly appreciated.
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

Post by kollurianu »

Now the function is working with some warnings
as below:

APT_CombinedOperatorController(1),0: Conversion error calling conversion routine date_from_string data may have been lost

And I have the Null field value set to 1950-01-01 to the date fields in the column properties.

Is that the right way set Null properties on the target file side.

Thank you all.
kollurianu
Premium Member
Premium Member
Posts: 614
Joined: Fri Feb 06, 2004 3:59 pm

Post by kollurianu »

All the Null dates are being written as ********** in the output file.
kumar_s
Charter Member
Charter Member
Posts: 5245
Joined: Thu Jun 16, 2005 11:00 pm

Post by kumar_s »

if you input format is differnt use the derivatin as StringToDate(DSLink92.PROCESS_DATE, "%yy%mm%dd%" )
Impossible doesn't mean 'it is not possible' actually means... 'NOBODY HAS DONE IT SO FAR'
savis
Premium Member
Premium Member
Posts: 27
Joined: Tue Apr 15, 2008 11:06 pm

Post by savis »

Hi,

hope this helps..

If Len(StageVar)=6 Then StringToDate(StageVar,"%2000yy%mm%dd") Else StringToDate(StageVar,"%yyyy%mm%dd")

Thanks,
Savis
Post Reply