About @DATE
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 28
- Joined: Wed Jan 11, 2006 8:29 pm
- Location: Singapore
- Contact:
About @DATE
Hi,
I am using @DATE function to populate current date value. When I was viewing DSDB2 column values using datastage after population, it shows values as 13914 (2006-02-03). In DB2 it shows in specific format 02/03/2006.
Why it is showing same value in two different ways?
How will I extract year and month values in the format "YYYYMM" from @DATE function
Thanks in advance.
I am using @DATE function to populate current date value. When I was viewing DSDB2 column values using datastage after population, it shows values as 13914 (2006-02-03). In DB2 it shows in specific format 02/03/2006.
Why it is showing same value in two different ways?
How will I extract year and month values in the format "YYYYMM" from @DATE function
Thanks in advance.
Thnaks and Regards,
AnjiReddy.
AnjiReddy.
@Date gives the Internal Date
13914 is the internal date of datastage
Did you check the DCode Function?
if not pls check it
it will help you with the all the Date conversions you need
and the answer for
is it mandatory that you extract YYYYMM from @Date only? There are lot other functions can give you the result
ex:@Year:@Month
13914 is the internal date of datastage
Did you check the DCode Function?
if not pls check it
it will help you with the all the Date conversions you need
and the answer for
will also be thereHow will I extract year and month values in the format "YYYYMM" from @DATE function
is it mandatory that you extract YYYYMM from @Date only? There are lot other functions can give you the result
ex:@Year:@Month
-
- Participant
- Posts: 28
- Joined: Wed Jan 11, 2006 8:29 pm
- Location: Singapore
- Contact:
Hi Vidya,
Thanks for ur response. I couldn't find any help on DCode function. Do u mean Iconv and Oconv or DCode is an independent one.
By using following expression I get YYYYMM format
Oconv(Iconv(@YEAR,"DY[2]"),"DY[4]") : Oconv(Iconv(@MONTH,"DM[2]"),"DM[2]")
I am curious to get by using @DATE
I was using the following expression to get
Oconv(@DATE,"DYM[4,2]")
but it gives a blank value between year and month.
Any help would be appreciated..
Thanks for ur response. I couldn't find any help on DCode function. Do u mean Iconv and Oconv or DCode is an independent one.
By using following expression I get YYYYMM format
Oconv(Iconv(@YEAR,"DY[2]"),"DY[4]") : Oconv(Iconv(@MONTH,"DM[2]"),"DM[2]")
I am curious to get by using @DATE
I was using the following expression to get
Oconv(@DATE,"DYM[4,2]")
but it gives a blank value between year and month.
Any help would be appreciated..
Thnaks and Regards,
AnjiReddy.
AnjiReddy.
Hi Puli.reddy,
try this to extract year and month values in the format "YYYYMM" from @DATE function
Oconv(@DATE, "D YM")
regards
kcs
Code: Select all
I am curious to get by using @DATE
I was using the following expression to get
Oconv(@DATE,"DYM[4,2]")
but it gives a blank value between year and month.
Oconv(@DATE, "D YM")
regards
kcs
Hi Angi garu
what did u mean by blank value?
The space coming between year and date?
the result for
will be 2006 02
the space,i guess., is the separator between year and month.Correct me if I'm wrong
to have a better idea., try this one
it will give the result as 2006-02
)
what did u mean by blank value?
The space coming between year and date?
the result for
Code: Select all
OConv(@Date,'DYM[4,2]')
will be 2006 02
the space,i guess., is the separator between year and month.Correct me if I'm wrong
to have a better idea., try this one
Code: Select all
OConv(@Date,'D-YM[4,2]')
it will give the result as 2006-02
its D Code not DCode....search for D Code (Space between D and CodeI couldn't find any help on DCode function.
![Smile :)](./images/smilies/icon_smile.gif)
-
- Charter Member
- Posts: 130
- Joined: Mon Sep 06, 2004 3:05 am
- Location: Dubai,UAE
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
This paper may also shed some light on date conversions.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 28
- Joined: Wed Jan 11, 2006 8:29 pm
- Location: Singapore
- Contact:
Thanks everyone
It seems every one is keen in posting a solution. I like this approach from this site. I never got quick solution from any other forum other than this. Keep it up dsxchangers....
Thanks everyone ..
The solution from Amruta is working in my case Oconv(@DATE,"DY") : Oconv(@DATE,"DM[2]")
Yes vidya I mean to say a space was coming between year and month.
Sekhar, ur method nor did
Thanks everyone ..
The solution from Amruta is working in my case Oconv(@DATE,"DY") : Oconv(@DATE,"DM[2]")
Yes vidya I mean to say a space was coming between year and month.
Sekhar, ur method nor did
Thnaks and Regards,
AnjiReddy.
AnjiReddy.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Code: Select all
Oconv(@DATE, "DYM[4,2]" : @VM : "MCN")
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.