Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.
Moderators: chulett , rschirm , roy
Champa
Participant
Posts: 88 Joined: Wed Dec 14, 2005 1:44 pm
Post
by Champa » Thu Aug 13, 2009 8:41 am
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
Champa
miwinter
Participant
Posts: 396 Joined: Thu Jun 22, 2006 7:00 am
Location: England, UK
Post
by miwinter » Thu Aug 13, 2009 8:50 am
Use WeekdayFromDate and then apply your own logic based on the origin day to return your alpha representation of "day of week"
Mark Winter
<i>Nothing appeases a troubled mind more than <b>good</b> music</i>
ArndW
Participant
Posts: 16318 Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:
Post
by ArndW » Thu Aug 13, 2009 8:50 am
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"
miwinter
Participant
Posts: 396 Joined: Thu Jun 22, 2006 7:00 am
Location: England, UK
Post
by miwinter » Thu Aug 13, 2009 8:58 am
For info... my 7.5.1. version of that guide - page 31 is still in the contents
Arnd - what's the section you were referring to please?
Mark Winter
<i>Nothing appeases a troubled mind more than <b>good</b> music</i>
arun_im4u
Premium Member
Posts: 104 Joined: Mon Nov 08, 2004 8:42 am
Post
by arun_im4u » Thu Aug 13, 2009 9:39 am
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.
miwinter
Participant
Posts: 396 Joined: Thu Jun 22, 2006 7:00 am
Location: England, UK
Post
by miwinter » Thu Aug 13, 2009 9:56 am
One option, but I'd suggest you don't if you are processing any kind of volumes.
Mark Winter
<i>Nothing appeases a troubled mind more than <b>good</b> music</i>
ArndW
Participant
Posts: 16318 Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:
Post
by ArndW » Thu Aug 13, 2009 9:59 am
ICONV() and OCONV() do not exist in parallel jobs and are thus, unfortunately, not an option here.
arun_im4u
Premium Member
Posts: 104 Joined: Mon Nov 08, 2004 8:42 am
Post
by arun_im4u » Thu Aug 13, 2009 10:10 am
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.
ArndW
Participant
Posts: 16318 Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:
Post
by ArndW » Thu Aug 13, 2009 10:16 am
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.
Champa
Participant
Posts: 88 Joined: Wed Dec 14, 2005 1:44 pm
Post
by Champa » Thu Aug 13, 2009 10:55 am
Thank you guys.
But I did not get any solution.
Champa
ArndW
Participant
Posts: 16318 Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:
Post
by ArndW » Thu Aug 13, 2009 11:15 am
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".
Champa
Participant
Posts: 88 Joined: Wed Dec 14, 2005 1:44 pm
Post
by Champa » Thu Aug 13, 2009 1:06 pm
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
Champa
arun_im4u
Premium Member
Posts: 104 Joined: Mon Nov 08, 2004 8:42 am
Post
by arun_im4u » Thu Aug 13, 2009 1:19 pm
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.
Champa
Participant
Posts: 88 Joined: Wed Dec 14, 2005 1:44 pm
Post
by Champa » Thu Aug 13, 2009 2:43 pm
Thank you Arun, I tried & with minor tweaks I got it.
Champa
chulett
Charter Member
Posts: 43085 Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO
Post
by chulett » Thu Aug 13, 2009 2:48 pm
Could you please post the syntax that ended up working for you? Thanks!
-craig
"You can never have too many knives" -- Logan Nine Fingers