Page 1 of 1

Reduce date by a day in job control

Posted: Thu Jun 10, 2010 5:56 am
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

Posted: Thu Jun 10, 2010 6:06 am
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.

Posted: Thu Jun 10, 2010 6:28 am
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.

Posted: Thu Jun 10, 2010 6:34 am
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.

Posted: Thu Jun 10, 2010 6:48 am
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.