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



Joined: 23 May 2006
Posts: 2
Location: Rennes (35) - France
Points: 25

Post Posted: Tue May 23, 2006 2:24 pm Reply with quote    Back to top    

DataStage® Release: 6x
Job Type: Server
OS: Windows
hello everybody,

i'm a new Datastage Developers.

i have a problem.

i explain myself :

i have to integrate one file into a data base.

the file is like it.

article;Qty1;Qty2;Qty3...Qt60

ex :
00001;1;2;3;4....60

the table in the data base is like this.

article - ref_Date - prevision_date - Qty

00001 - 20060523 - 20060529 - 1
00001 - 20060523 - 20060605 - 2
...


ref_Date is sysdate (i do not have any problem with tis)

the prevision_date is the next 60 monday. (one for each column in the file.)


so, my problem is.

how to get the date of the next monday. (the others will be next monday + 7 days...)

i wish you understand my problem.

thanks for your attention.

PS : sorry for my poor english, but i'm french and i do not speak english.

bye.

jerome
ray.wurlod

Premium Poster
Participant

Group memberships:
Premium Members, Inner Circle, Australia Usergroup, Server to Parallel Transition Group

Joined: 23 Oct 2002
Posts: 54072
Location: Sydney, Australia
Points: 293282

Post Posted: Tue May 23, 2006 2:34 pm Reply with quote    Back to top    

The trick you need is to realize that the internal format of dates in server jobs is an integer. If you divide by 7 and take the remainder (the Mod() function), then the result is 0 for Sunday, 1 for ...

_________________
RXP Services Ltd
Melbourne | Canberra | Sydney | Hong Kong | Hobart | Brisbane
currently hiring: Canberra, Sydney and Melbourne
Rate this response:  
Not yet rated
petburn
Participant



Joined: 23 May 2006
Posts: 2
Location: Rennes (35) - France
Points: 25

Post Posted: Tue May 23, 2006 2:51 pm Reply with quote    Back to top    

thanks, i'll test it tomorow.

bye.
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