i enter year through parameter need all days to be dispalyed

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
chandra
Participant
Posts: 88
Joined: Sun Apr 02, 2006 6:50 pm
Location: India

i enter year through parameter need all days to be dispalyed

Post by chandra »

I want to display all the days which present in year !

any logic is appreciated..
chandra ,
Hyd
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Convert the first day of the parameter year to internal format and then increment by 1 until the year changes. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chandra
Participant
Posts: 88
Joined: Sun Apr 02, 2006 6:50 pm
Location: India

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

Post 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.
Post Reply