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

Star Schema vs. Snow Flake Schema. What is the best model for DW? Give example for both the models performance wise?

3 Answers   IBM, TCS,


How do you design PX Routines ?

1 Answers  


How the ipc stage work?

0 Answers  


hi i am bhavani, in real time data stage who is the source provide? and how to recevied in developer? Pls send me answer

1 Answers   Polaris,


Sequential file i have one record,i want 100 records in target?How can we do that?Pls explain me and what stages are there?What logic?

1 Answers   TCS,






Differentiate between data file and descriptor file?

0 Answers  


HOW CAN U DO ERROR HANDLING IN DATA STAGE?

8 Answers   ME,


How to delete the data in dataset?types of deleting the data in dataset?

4 Answers   HSBC,


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,


how can we create tables in datastage?

1 Answers  


if i have two tables table1 table2 1a 1a,b,c,d 1b 2a,b,c,d,e 1c 1d 2a 2b 2c 2d 2e how can i get data as same as in tables? how can i implement scd typ1 and type2 in both server and in parallel? field1 field2 field3 suresh , 10,324 , 355 , 1234 ram , 23,456 , 450 , 456 balu ,40,346,23 , 275, 5678 how to remove the duplicate rows,inthe fields?

0 Answers   IBM,


How to Remove Duplicate using SQL?

0 Answers   CTS,


Categories