How to subtract 1 day from a parameter date in the transform

Archive of postings to DataStageUsers@Oliver.com. This forum intended only as a reference and cannot be posted to.

Moderators: chulett, rschirm

Locked
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

How to subtract 1 day from a parameter date in the transform

Post by admin »

This is a topic for an orphaned message.
admin
Posts: 8720
Joined: Sun Jan 12, 2003 11:26 pm

Post by admin »

Hello Mike,

Thanks for the advice. We are currently running v4.2 of DataStage.

I had tested it against v4.1 and the date subtraction worked fine. This is a bug.

I had already logged a call with Ascential.

Thanks.

Cheers,
Paul.


-----Original Message-----
From: michael.ruland@ascentialsoftware.com
[mailto:michael.ruland@ascentialsoftware.com]
Sent: Friday, 02 November, 2001 4:07 a.m.
To: datastage-users@oliver.com
Subject: RE: How to subtract 1 day from a parameter date in the transform stag e for OS/390


Paul,

Your technique is valid. What release of DataStage are you running? Have you checked with Ascential support to assure you have the correct patch levels installed on your client workstation?

Mike Ruland.

-----Original Message-----
From: Paul Ko [mailto:PKO@clear.co.nz]
Sent: Wednesday, October 31, 2001 9:37 PM
To: datastage-users@oliver.com
Subject: How to subtract 1 day from a parameter date in the transform stag e for OS/390


Hello,

I have a date reading from a parameter file. Its format is CCYY-MM-DD.

What I wish to achieve is to subtract 1 from the parameter date? Mind that I am using Datastage OS/390.

I tried the following command but it did not return the expected result. The result returns me with the original date.

Below is my command used in the TRANSFORMATION stage: CAST(((CAST((CAST(JobParam.P_SNPSHT_DT AS DATE)) AS INT)) - 1) AS DATE)

The 3rd CAST is to convert the parameter date (in char format) to a date format. The 2nd CAST is to convert the date into integer. The 1st CAST is to convert the integer (after subtracting 1) to a date.

Cheers,
Paul.
Locked