Day in Date

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

Day in Date

Post 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
Champa
miwinter
Participant
Posts: 396
Joined: Thu Jun 22, 2006 7:00 am
Location: England, UK

Post by miwinter »

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 »

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 »

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?
Mark Winter
<i>Nothing appeases a troubled mind more than <b>good</b> music</i>
arun_im4u
Premium Member
Premium Member
Posts: 104
Joined: Mon Nov 08, 2004 8:42 am

Post 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.
miwinter
Participant
Posts: 396
Joined: Thu Jun 22, 2006 7:00 am
Location: England, UK

Post by miwinter »

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 »

ICONV() and OCONV() do not exist in parallel jobs and are thus, unfortunately, not an option here.
arun_im4u
Premium Member
Premium Member
Posts: 104
Joined: Mon Nov 08, 2004 8:42 am

Post 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.
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
Champa
Participant
Posts: 88
Joined: Wed Dec 14, 2005 1:44 pm

Post by Champa »

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 »

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 »

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
Premium Member
Posts: 104
Joined: Mon Nov 08, 2004 8:42 am

Post 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.
Champa
Participant
Posts: 88
Joined: Wed Dec 14, 2005 1:44 pm

Post by Champa »

Thank you Arun, I tried & with minor tweaks I got it.
Champa
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Could you please post the syntax that ended up working for you? Thanks!
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply