Page 1 of 2

Day in Date

Posted: Thu Aug 13, 2009 8:41 am
by Champa
Hi,

I need to get day - mon/tue ... like that from today's date. I did not find any date function for that.

Can you please help.


Thanks

Posted: Thu Aug 13, 2009 8:50 am
by miwinter
Use WeekdayFromDate and then apply your own logic based on the origin day to return your alpha representation of "day of week"

Posted: Thu Aug 13, 2009 8:50 am
by ArndW
Page 31 of the DataStage Parallel Developer Guide tells you what date mask to use. For the day-of-week in text form you would use the mask of "%eee"

Posted: Thu Aug 13, 2009 8:58 am
by miwinter
For info... my 7.5.1. version of that guide - page 31 is still in the contents :lol:

Arnd - what's the section you were referring to please?

Posted: Thu Aug 13, 2009 9:39 am
by arun_im4u
Use a basic transformer in the job and use the iconv-oconv function to determine the day of the week.

Help guide on the iconv-oconv functions would tell you how to use them.

Posted: Thu Aug 13, 2009 9:56 am
by miwinter
One option, but I'd suggest you don't if you are processing any kind of volumes.

Posted: Thu Aug 13, 2009 9:59 am
by ArndW
ICONV() and OCONV() do not exist in parallel jobs and are thus, unfortunately, not an option here.

Posted: Thu Aug 13, 2009 10:10 am
by arun_im4u
But ArndW, can't we use a BASIC transformer in a parallel job and use the iconv/oconv function in it?

I do not have a system to test this out.

Posted: Thu Aug 13, 2009 10:16 am
by ArndW
Yes, you can use a BASIC transform stage in a PX job to do this. It can cause performance issues and is generally not recommended, though.

Posted: Thu Aug 13, 2009 10:55 am
by Champa
Thank you guys.

But I did not get any solution.

Posted: Thu Aug 13, 2009 11:15 am
by ArndW
QualityStageParallel Job Developer Guide page 31 as marked at the bottom of the actual page, page 43/637 according to the PDF counter on the top. Alternately search the document for "%E".

Posted: Thu Aug 13, 2009 1:06 pm
by Champa
Hi again,

What am I doing wrong? Please let me know.

Oconv(@Date,"%eeee, %dd %mmmm %yyyy")

it gives some numeric - 15201

What I want is day of the week.

Thanks

Posted: Thu Aug 13, 2009 1:19 pm
by arun_im4u
Champa--

The code has to be something like this. Search for "D code" in the help guide. You will need to format the date appropriately.

Oconv(Iconv(date, "D"), "DWA")

But this option will run sequentially and will have a performance impact.

Posted: Thu Aug 13, 2009 2:43 pm
by Champa
Thank you Arun, I tried & with minor tweaks I got it.

Posted: Thu Aug 13, 2009 2:48 pm
by chulett
Could you please post the syntax that ended up working for you? Thanks!