How to subtract 1 day from a parameter date in the transform
How to subtract 1 day from a parameter date in the transform
This is a topic for an orphaned message.
Firstly transform the date paramater into Datastage internal date and then subtract 1 from it:
iconv(Date, "DYMD") -1
if you want the result back in the same date format as the date passed:
oconv(iconv(Date, "DYMD") -1, "D-YMD")
regards,
Wendy Voon
Consultant
Black Diamond
T e c h n o l o g i e s
Level 3, 1 Southbank Boulevard,
Southbank, Victoria 3006
E-mail: wendy.voon@team.telstra.com
Telephone: (03) 8696 - 5023
> -----Original Message-----
> From: Paul Ko [SMTP:PKO@clear.co.nz]
> Sent: Thursday, 1 November 2001 2: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.
iconv(Date, "DYMD") -1
if you want the result back in the same date format as the date passed:
oconv(iconv(Date, "DYMD") -1, "D-YMD")
regards,
Wendy Voon
Consultant
Black Diamond
T e c h n o l o g i e s
Level 3, 1 Southbank Boulevard,
Southbank, Victoria 3006
E-mail: wendy.voon@team.telstra.com
Telephone: (03) 8696 - 5023
> -----Original Message-----
> From: Paul Ko [SMTP:PKO@clear.co.nz]
> Sent: Thursday, 1 November 2001 2: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.
Wendy,
The functions you know and love are not available in DS/390 (mainframe jobs). This is why Paul specified that hes using the mainframe version.
-----Original Message-----
From: Voon, Wendy [mailto:Wendy.Voon@team.telstra.com]
Sent: Thursday, 01 November 2001 15:00
To: datastage-users@oliver.com
Subject: RE: How to subtract 1 day from a parameter date in the transform stag e for OS/390
Firstly transform the date paramater into Datastage internal date and then subtract 1 from it:
iconv(Date, "DYMD") -1
if you want the result back in the same date format as the date passed:
oconv(iconv(Date, "DYMD") -1, "D-YMD")
regards,
Wendy Voon
Consultant
Black Diamond
T e c h n o l o g i e s
Level 3, 1 Southbank Boulevard,
Southbank, Victoria 3006
E-mail: wendy.voon@team.telstra.com
Telephone: (03) 8696 - 5023
> -----Original Message-----
> From: Paul Ko [SMTP:PKO@clear.co.nz]
> Sent: Thursday, 1 November 2001 2: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.
The functions you know and love are not available in DS/390 (mainframe jobs). This is why Paul specified that hes using the mainframe version.
-----Original Message-----
From: Voon, Wendy [mailto:Wendy.Voon@team.telstra.com]
Sent: Thursday, 01 November 2001 15:00
To: datastage-users@oliver.com
Subject: RE: How to subtract 1 day from a parameter date in the transform stag e for OS/390
Firstly transform the date paramater into Datastage internal date and then subtract 1 from it:
iconv(Date, "DYMD") -1
if you want the result back in the same date format as the date passed:
oconv(iconv(Date, "DYMD") -1, "D-YMD")
regards,
Wendy Voon
Consultant
Black Diamond
T e c h n o l o g i e s
Level 3, 1 Southbank Boulevard,
Southbank, Victoria 3006
E-mail: wendy.voon@team.telstra.com
Telephone: (03) 8696 - 5023
> -----Original Message-----
> From: Paul Ko [SMTP:PKO@clear.co.nz]
> Sent: Thursday, 1 November 2001 2: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.
This is a mainframe job!
-----Original Message-----
From: Voon, Wendy [mailto:Wendy.Voon@team.telstra.com]
Sent: Thursday, November 01, 2001 5:00 PM
To: datastage-users@oliver.com
Subject: RE: How to subtract 1 day from a parameter date in the transform stag e for OS/390
Firstly transform the date paramater into Datastage internal date and then subtract 1 from it:
iconv(Date, "DYMD") -1
if you want the result back in the same date format as the date passed:
oconv(iconv(Date, "DYMD") -1, "D-YMD")
regards,
Wendy Voon
Consultant
Black Diamond
T e c h n o l o g i e s
Level 3, 1 Southbank Boulevard,
Southbank, Victoria 3006
E-mail: wendy.voon@team.telstra.com
Telephone: (03) 8696 - 5023
> -----Original Message-----
> From: Paul Ko [SMTP:PKO@clear.co.nz]
> Sent: Thursday, 1 November 2001 2: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.
-----Original Message-----
From: Voon, Wendy [mailto:Wendy.Voon@team.telstra.com]
Sent: Thursday, November 01, 2001 5:00 PM
To: datastage-users@oliver.com
Subject: RE: How to subtract 1 day from a parameter date in the transform stag e for OS/390
Firstly transform the date paramater into Datastage internal date and then subtract 1 from it:
iconv(Date, "DYMD") -1
if you want the result back in the same date format as the date passed:
oconv(iconv(Date, "DYMD") -1, "D-YMD")
regards,
Wendy Voon
Consultant
Black Diamond
T e c h n o l o g i e s
Level 3, 1 Southbank Boulevard,
Southbank, Victoria 3006
E-mail: wendy.voon@team.telstra.com
Telephone: (03) 8696 - 5023
> -----Original Message-----
> From: Paul Ko [SMTP:PKO@clear.co.nz]
> Sent: Thursday, 1 November 2001 2: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.
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.
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.