Reduce date by a day in job control

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
harsha_blm
Participant
Posts: 10
Joined: Tue Jun 19, 2007 1:16 am
Location: Bangalore

Reduce date by a day in job control

Post by harsha_blm »

Hi All,

Kindly guide me for the below problem.

I need to substract a day from to date and carry the value for further processing.Pls help me out.

input format of date:
DATE_TO=18/02/2010

D1=Iconv(DATE_TO, "D2/")
D2=D1-1
TSTAMP1 = oconv(D2,"DDMY[2,2,4]")
DD = TSTAMP1[1,2]
MM = TSTAMP1[4,2]
YYYY = TSTAMP1[7,4]
FILEDATE = DDMMYYYY

Tried above but not getting the right value for FILEDATE.
FILEDATE EXPECTED:17022010


Thanks in Advance,

Harsha
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Perhaps just?

Code: Select all

FILEDATE = DD : MM : YYYY
You could also simply use Convert() to remove any delimiters that OConv() added to the date rather than chopping it up and reassembling it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
harsha_blm
Participant
Posts: 10
Joined: Tue Jun 19, 2007 1:16 am
Location: Bangalore

Post by harsha_blm »

chulett wrote:Perhaps just?

Code: Select all

FILEDATE = DD : MM : YYYY
You could also simply use Convert() to remove any delimiters that OConv() added to the date rather than chopping it up and reassembling i ...

Hi,

Tried the above but it's not working to the expectation.

Thanks in Advance.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Why don't you start by expanding "not working to expectation" by giving more details about the output / error / warning ?

Also display the output you obtained from each step of your code so others can guide from there.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Exactly, simply saying something is "not working" doesn't help anyone help you. :?

Make liberal use of the DSLogInfo() function to log your intermediate values if you are unsure where exactly things are going wrong. That or use the Manager to test your job and tweak it to pass back more than just your 'Answer' while you debug it.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply