DSXchange: DataStage and IBM Websphere Data Integration Forum
View next topic
View previous topic
Add To Favorites
Author Message
wilsonburazon
Participant



Joined: 23 Aug 2017
Posts: 3

Points: 19

Post Posted: Wed Aug 23, 2017 9:52 am Reply with quote    Back to top    

DataStage® Release: 11x
Job Type: Parallel
OS: Windows
Is there any way in a transformer stage or any stage to know the specific day of a month? How do you know if the input is the first Monday of the month.
UCDI



Group memberships:
Premium Members

Joined: 21 Mar 2016
Posts: 270

Points: 2706

Post Posted: Wed Aug 23, 2017 10:04 am Reply with quote    Back to top    

what about

NextWeekdayFromDate
or
NthWeekdayFromDate
Rate this response:  
Not yet rated
qt_ky



Group memberships:
Premium Members

Joined: 03 Aug 2011
Posts: 2665
Location: USA
Points: 19822

Post Posted: Wed Aug 23, 2017 10:30 am Reply with quote    Back to top    

For first Monday of the month, try using WeekdayFromDate() to check if it is Monday along with checking if the day number of the month is <= 7.

_________________
Choose a job you love, and you will never have to work a day in your life. - Confucius
Rate this response:  
Not yet rated
wilsonburazon
Participant



Joined: 23 Aug 2017
Posts: 3

Points: 19

Post Posted: Wed Aug 23, 2017 11:37 am Reply with quote    Back to top    

What if I have input records:
2017-08-04
2017-08-14
2017-08-21
2017-08-28

If I use WeekdayFromDate, all these records will return 1 (Monday). My goal is to find only the 2017-08-04.

Thanks for the reply tho.
Rate this response:  
Not yet rated
UCDI



Group memberships:
Premium Members

Joined: 21 Mar 2016
Posts: 270

Points: 2706

Post Posted: Wed Aug 23, 2017 11:56 am Reply with quote    Back to top    

that is why he said weekday <= 7 or <8 if you prefer.

14,21, and 28 fail this conditional.
Rate this response:  
Not yet rated
wilsonburazon
Participant



Joined: 23 Aug 2017
Posts: 3

Points: 19

Post Posted: Wed Aug 23, 2017 12:01 pm Reply with quote    Back to top    

Cool. Got it! Thanks! Smile
Rate this response:  
Not yet rated
Display posts from previous:       

Add To Favorites
View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Powered by phpBB © 2001, 2002 phpBB Group
Theme & Graphics by Daz :: Portal by Smartor
All times are GMT - 6 Hours