Page 1 of 1

i enter year through parameter need all days to be dispalyed

Posted: Mon Apr 17, 2006 3:09 pm
by chandra
I want to display all the days which present in year !

any logic is appreciated..

Posted: Mon Apr 17, 2006 3:22 pm
by chulett
Convert the first day of the parameter year to internal format and then increment by 1 until the year changes. :wink:

Posted: Mon Apr 17, 2006 3:24 pm
by ray.wurlod
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

Code: Select all

Transformer  ---->  SequentialFile
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.

Posted: Mon Apr 17, 2006 9:52 pm
by chandra
i think will it workd like this
suppose year 2006
i would like to know is there any function called DDD || w in datastage .
in that case we will use DDD and W functions
my PC is not installed with datastage , im just trying .

thnks

Posted: Tue Apr 18, 2006 12:48 am
by ArndW
Chandra, even though Ray's answer is by far the easiest, there are a number of date functions available to you by using the OCONV function and the "D{options}" Date conversion. You can get your date formatted to WWW or even to the Chinese year names if you want.