I want to display all the days which present in year !
any logic is appreciated..
i enter year through parameter need all days to be dispalyed
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
DataStage is not able to display anything, since it always runs background processes. I assume, therefore, that you want to generate 365 or 366 rows in a server job and have a separate date in each.
Your job can be as simple as
Create a stage variable initialized to 1 and incrementing by 1. Constrain the output so that that this stage variable can not exceed 366.
Create another stage variable that contains the internal format of the day prior to the current year. Initialize to Iconv(#Year#:"-01-01","DYMD")-1
Create yet another stage variable that is the sum of the previous two to which an Oconv() function is applied to generate the date in your required format. Constrain the output so that the month must be December if the first stage variable is 366.
Populate the date output column with the third stage variable.
Your job can be as simple as
Code: Select all
Transformer ----> SequentialFile
Create another stage variable that contains the internal format of the day prior to the current year. Initialize to Iconv(#Year#:"-01-01","DYMD")-1
Create yet another stage variable that is the sum of the previous two to which an Oconv() function is applied to generate the date in your required format. Constrain the output so that the month must be December if the first stage variable is 366.
Populate the date output column with the third stage variable.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.