using date_from_string function in modify stage

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
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

using date_from_string function in modify stage

Post by balajisr »

Hi

I have input data Datestring as string to the modify stage in the format "05112005"(ddmmyyyy)

Using modify stage i need to convert the Datestring to date 11-05-2005(mm-dd-yyyy).

In the specification property of modify stage i type:

Newdate:date = date_from_string[%dd%mm%yyyy](Datestring)

The result being date converted as "2005-11-05"(yyyy-mm-dd) which is the default format of datastage

Is there any way i can convert date in one format to another format other than yyyy-mm-dd using date_from_string function using modify stage.

Thanks
Balaji
sudarshan
Participant
Posts: 11
Joined: Fri Jun 17, 2005 7:41 am

Re: using date_from_string function in modify stage

Post by sudarshan »

Hi Balajisr,

If you go to EDIT->PROPERTIES and edit the job properties in the Defaults tab you can find the default date and time formats used for the job. There u can set your specific format to be used for the job.

:)
Sudarshan
balajisr
Charter Member
Charter Member
Posts: 785
Joined: Thu Jul 28, 2005 8:58 am

Post by balajisr »

Hi

Thanks for your reply.

That is correct. I want to know whether we can override the default date format say i have three date columns and i want each date column to have different date format.Is this possible in modify stage?

Thanks
Balaji
sudarshan
Participant
Posts: 11
Joined: Fri Jun 17, 2005 7:41 am

Post by sudarshan »

Hey,

Can u plss explain what use it will be to store three date fields in three different formats unless u r storing em as string ... because, whichever database u use will ultimately write to will store em in only one format. So, can u plss specify the datatypes u r abt to use, ur target and what exactly u want to achieve.

:)
Sudarshan
Post Reply