how do u convert date in 20-12-07 to dec-20-2007 or 20-dec-
2007 or 20-dec-07 in parallel

Answers were Sorted based on User's Feedback



how do u convert date in 20-12-07 to dec-20-2007 or 20-dec- 2007 or 20-dec-07 in parallel..

Answer / shar

First see what is the default date format of the project.
Generally it would be “%yyyy-%mm-%dd”
Then u need to change it to ur required format like :
“%dd-%mm-%yy”
Since the year is 2 digit year then u will have to mention
its four digit year before yy because datastage cannot
understand the latest and old year and it simply consider
year from 1900 century on wards.
So u will have to mention at ur job properties under default
at date as : “%dd-%mm-%2000yy” (must) without which
datastage will not consider u r given date format in
transformer stage date function and it simply go with the
Project’s default date format.
And also mentioning “%dd-%mm-%2000yy” format at job
properties and not mentioning “%dd-%mm-%2000yy” at
transformer stage also works fine.
Ex: if your date is (20-12-07,”%dd-%mm-%yy”) then datastage
consider default date format at job properties and will go
accordingly. And output will be 20-12-2007. And if
“%dd-%mm-%yy” is mentioned at job properties and u have
mentioned (20-12-07,”%dd-%mm-%2000yy”) then datastage will
not consider ur date format and simply it gives the output
as 1907-12-20.
So it is a good practice to see the default date format
assigned to the project and make changes accordingly and
attempt to do the process with it.
DateToString(StringToDate(DSLink3.date,"%dd-%mm-%2000yy"),"%mmm-%dd-%yyyy")
- dec-20-2007
DateToString(StringToDate(DSLink3.date,"%dd-%mm-%2000yy"),"%dd-%mmm-%yyyy")
-20-dec- 2007
DateToString(StringToDate(DSLink3.date,"%dd-%mm-%2000yy"),"%dd-%mmm-%yy")
- 20-dec-07

Now That’s what I call it cooooll.

Is This Answer Correct ?    6 Yes 0 No

how do u convert date in 20-12-07 to dec-20-2007 or 20-dec- 2007 or 20-dec-07 in parallel..

Answer / prasad

use column datatype as varchar

DateToString(StringToDate(DSLink3.DateColumn,'%dd-%mm-%2000yy'),'%mmm-%dd-%yyyy')

use above format in derivation for transformer stage, u will get the desired output.

Is This Answer Correct ?    2 Yes 0 No

how do u convert date in 20-12-07 to dec-20-2007 or 20-dec- 2007 or 20-dec-07 in parallel..

Answer / shar

if you still have any doubts just mail me.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Data Stage Interview Questions

Hi All, I have a file. i need to fetch the records between first and last records by using transform stage. EX:- Source: EMPNO EMPNAME 4567 shree 6999 Ram 3265 Venkat 2655 Abhi 3665 Vamsi 5852 Amit 3256 Sagar 3265 Vishnu Target: EMPNO EMPNAME 6999 Ram 3265 Venkat 2655 Abhi 3665 Vamsi 5852 Amit 3256 Sagar I dont wan't to Shree and vishnu records.we can fetch another way also but How can I write the function in transform stage?

2 Answers   TCS,


what is the use of surogate key in datastage

3 Answers  


What is developer responsibilities in UAT (user acceptance testing and Post implementation phase?

0 Answers  


can any one tell me how to install datastage 8.1 in windows xp with wizard

2 Answers  


How to convert table data into xml file using xml output stage? please explain step by step;

2 Answers   IBM,






if ename='subbu' while running job the job should be abort how come?

3 Answers   IBM,


i have a scenario in which i/p columns areID,salary with 1,1000 2,2000 and 3,3000 i need an extra column in the o/p named avg(salary)how can i get it?

4 Answers   L&T,


HOW CAN WE SEE THE DATA IN DATASET?

4 Answers  


how do you pass parameters in a script?

1 Answers   L&T,


Wat is isolation level and when do u use them?

1 Answers   HP, IBM,


What is the difference between an operational datastage and a data warehouse?

0 Answers  


What is a folder? Difference types of stages?

0 Answers  


Categories