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

Question 4) source target c1 c1 c2 c3 c2 c4 c4 c5 c3 c6 c7 c4 c5 c6 c7 Singal Source and Singal Target only subash,

3 Answers   TCS,


5) A file contains 10 (1-10) I want trgt like Trgt 1 trgt 2 trgt 3 1 2 3 4 5 6 7 8 9 10

2 Answers  


if a column contains data like ram,rakesh,madhan,suraj,pradeep,bhaskar then I want to place names separated by commas in another columns how can we do?

5 Answers  


what is flow of project?

0 Answers   HSBC, IBM,


What is the Difference between Change capture stage and Difference Stage ? What are its significance individually ?

1 Answers  






How many Key we can define in remove duplicate stage?

0 Answers   CTS,


How to lode data in sequntional files perform faster?

1 Answers   Polaris,


How can we run same job in 1 day 2 times

7 Answers   IBM,


4) source target c1 c1 c2 c3 c2 c4 c4 c5 c3 c6 c7 c4 c5 c6 c7 please send me answer this question my mail

1 Answers  


Terminate Activity

0 Answers   CTS,


I HAVE EMP TABLE, 4 COLS R THERE COL1,COL2,COL3,COL4 ID-- 101,102,103,104 SAL-- 1000,4000,2000,5000 DATE-- COLUMN. I WANT TO DISPLAY THE DATA PREVIOUS MONTH HIGEST SAL ?

2 Answers   Wipro,


Which type of joins Merge stage can support?

7 Answers   IBM,


Categories