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

1)How to do error handling in datastage? 2)Did sequential stage accepts .xl files ,xml? znd how?

2 Answers   UHG,


can any 1 put a difference between datastage 7.5 and 8.0 all concepts plz r mail 2 me anu4u09@gmail.com

4 Answers   IBM,


What is the difference b/w Hash file and Lookup Fileset stages?

1 Answers  


Instead of using shared container in a job, I use jobs which perform similar function as Container in the sequence. Then what is the need of Shared Container?

1 Answers   TCS,


Hi All, Could you please let me know whether Datastage server and px supports oredb? OREDB:It's a Oracle Retail Embedded Database.Previousely It was called as Acumate data base. It's a multidimensional database. Please help me on this issue ASAP. Thanks in advance Ashok

1 Answers   Accenture,






On which interface you will be working as a developer?

0 Answers  


What's the Main Function of the Staging area in DWH

3 Answers   Oracle,


how will u design file watch jobs?

2 Answers  


what are the errors,warnings in datastage

0 Answers   Syntel, Wipro,


how to abort the job its matain duplicates?

0 Answers   TCS,


I am running a job with 1000 records.. If the job gots aborted after loading 400 records into target... In this case i want to load the records in the target with 401 record... How will we do it??? This scenario is not for sequence job it's only in the job Ex: Seq file--> Trans--> Dataset..

9 Answers   Cognizant, IBM, TCS, Virtusa,


I WANT TO SEND SYSDATE AS PARAMETER,SO WHAT COMMAND I SHOULD USE TO CALL SYSDATE?

4 Answers   ME,


Categories