Subtract 1 month from any date given

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
myukassign
Premium Member
Premium Member
Posts: 238
Joined: Fri Jul 25, 2008 8:55 am

Subtract 1 month from any date given

Post by myukassign »

Can anyone help me to resolve this issue?

I want to reduce 1 month from anydate given and should give me the new date. This should be done thorugh the transformer.

Can anyone tell me a function and its usage?
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

There are various ways to do this using different functions. The answer depends on how you define "subtract one month". What is one month less than "July 31"? The simple method is to use ICONV() and OCONV() to convert a display date into an internal date, then subtract 30 and reconvert to a display date. But this might not satisfy your rules and a more complex method would need to be used.
Last edited by ArndW on Wed Jul 30, 2008 7:17 am, edited 1 time in total.
myukassign
Premium Member
Premium Member
Posts: 238
Joined: Fri Jul 25, 2008 8:55 am

Post by myukassign »

Oho that function is working for me....

Thanks for the reply...
myukassign
Premium Member
Premium Member
Posts: 238
Joined: Fri Jul 25, 2008 8:55 am

Post by myukassign »

Oho that function is working for me....

Thanks for the reply...
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

ArndW wrote:The simple method is to use ICONV() and OCONV() to convert a display date
Fixed that for ya. :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Fixed what, Craig :twisted: (I love revisionist history)
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Dang, where's a WABAC machine when you need one? :lol:
-craig

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