Hi,
This is for Unidata 8.2.
For years I thought the following was equivalent:
ICONV(DTE,'D')
ICONV(DTE,'D2/')
ICONV(DTE,'D4/)
My assumption was that Unidata did not care about the number or the slash and just did an internal date conversion.
Today I learned that it is not.
While entering 1/11/11 all return 15717 as does 1/11/2011 as does 11 JAN 2011 as does 11 JAN 11 but entering 11012011 does not.
ICONV(DTE,'D') returns 15717
ICONV(DTE,'D2/') returns 19004
ICONV(DTE,'D4/) returns 15717
Is this a bug or does this jibe with your understanding?
Thanks,
Steve
Page 1 / 1
Hi,
This is for Unidata 8.2.
For years I thought the following was equivalent:
ICONV(DTE,'D')
ICONV(DTE,'D2/')
ICONV(DTE,'D4/)
My assumption was that Unidata did not care about the number or the slash and just did an internal date conversion.
Today I learned that it is not.
While entering 1/11/11 all return 15717 as does 1/11/2011 as does 11 JAN 2011 as does 11 JAN 11 but entering 11012011 does not.
ICONV(DTE,'D') returns 15717
ICONV(DTE,'D2/') returns 19004
ICONV(DTE,'D4/) returns 15717
Is this a bug or does this jibe with your understanding?
Thanks,
Steve
This is for Unidata 8.2.
For years I thought the following was equivalent:
ICONV(DTE,'D')
ICONV(DTE,'D2/')
ICONV(DTE,'D4/)
My assumption was that Unidata did not care about the number or the slash and just did an internal date conversion.
Today I learned that it is not.
While entering 1/11/11 all return 15717 as does 1/11/2011 as does 11 JAN 2011 as does 11 JAN 11 but entering 11012011 does not.
ICONV(DTE,'D') returns 15717
ICONV(DTE,'D2/') returns 19004
ICONV(DTE,'D4/) returns 15717
Is this a bug or does this jibe with your understanding?
Thanks,
Steve
If you are still getting ICONV( "01/11/11", "D2/") to return 19004, then please open a support case with your Rocket U2 Support Provider.
Note I did a quick test, and I am not getting what you are getting:
:CT BP THEDATE
BP:
THEDATE
CRT "ENTER THE DATE":;INPUT ODATE
CRT "D - ":ICONV(ODATE, "D")
CRT "D2/- ":ICONV(ODATE, "D2/")
PRINT "D4/- ":ICONV(ODATE, "D4/")
------
:RUN BP THEDATE
ENTER THE DATE?011111
D - 15717
D2/- 15717
D4/- 15717
:RUN BP THEDATE
ENTER THE DATE?01/11/11
D - 15717
D2/- 15717
D4/- 15717
:RUN BP THEDATE
ENTER THE DATE?01/11/2011
D - 15717
D2/- 15717
D4/- 15717
Hi,
This is for Unidata 8.2.
For years I thought the following was equivalent:
ICONV(DTE,'D')
ICONV(DTE,'D2/')
ICONV(DTE,'D4/)
My assumption was that Unidata did not care about the number or the slash and just did an internal date conversion.
Today I learned that it is not.
While entering 1/11/11 all return 15717 as does 1/11/2011 as does 11 JAN 2011 as does 11 JAN 11 but entering 11012011 does not.
ICONV(DTE,'D') returns 15717
ICONV(DTE,'D2/') returns 19004
ICONV(DTE,'D4/) returns 15717
Is this a bug or does this jibe with your understanding?
Thanks,
Steve
This is for Unidata 8.2.
For years I thought the following was equivalent:
ICONV(DTE,'D')
ICONV(DTE,'D2/')
ICONV(DTE,'D4/)
My assumption was that Unidata did not care about the number or the slash and just did an internal date conversion.
Today I learned that it is not.
While entering 1/11/11 all return 15717 as does 1/11/2011 as does 11 JAN 2011 as does 11 JAN 11 but entering 11012011 does not.
ICONV(DTE,'D') returns 15717
ICONV(DTE,'D2/') returns 19004
ICONV(DTE,'D4/) returns 15717
Is this a bug or does this jibe with your understanding?
Thanks,
Steve
>RUN GDS.BP TEST.DATA
ENTER THE DATE?1/11/11
D - 16011
D2/- 16011
D4/- 16011
>RUN GDS.BP TEST.DATA
ENTER THE DATE?1/11/2011
D - 16011
D2/- 16011
D4/- 16011
>RUN GDS.BP TEST.DATA
ENTER THE DATE?11 JAN 2011
D - 15717
D2/- 15717
D4/- 15717
>RUN GDS.BP TEST.DATA
ENTER THE DATE?01 NOV 2011
D - 16011
D2/- 16011
D4/- 16011
>RUN GDS.BP TEST.DATA
ENTER THE DATE?11 JAN 11
D - 15717
D2/- 15717
D4/- 15717
>RUN GDS.BP TEST.DATA
ENTER THE DATE?01 NOV 11
D - 16011
D2/- 16011
D4/- 16011
>RUN GDS.BP TEST.DATA
ENTER THE DATE?11012011
D - 15717
D2/-
D4/-
>
So an 8 digit number is not being converted to a date using the 'D', 'D2/' or 'D4/' date format codes.
However, if you use the 'DI' conversion code it works fine:
>OCONV 11012011 DI
OCONV('11012011','DI') = '15717'
>
Hi,
This is for Unidata 8.2.
For years I thought the following was equivalent:
ICONV(DTE,'D')
ICONV(DTE,'D2/')
ICONV(DTE,'D4/)
My assumption was that Unidata did not care about the number or the slash and just did an internal date conversion.
Today I learned that it is not.
While entering 1/11/11 all return 15717 as does 1/11/2011 as does 11 JAN 2011 as does 11 JAN 11 but entering 11012011 does not.
ICONV(DTE,'D') returns 15717
ICONV(DTE,'D2/') returns 19004
ICONV(DTE,'D4/) returns 15717
Is this a bug or does this jibe with your understanding?
Thanks,
Steve
This is for Unidata 8.2.
For years I thought the following was equivalent:
ICONV(DTE,'D')
ICONV(DTE,'D2/')
ICONV(DTE,'D4/)
My assumption was that Unidata did not care about the number or the slash and just did an internal date conversion.
Today I learned that it is not.
While entering 1/11/11 all return 15717 as does 1/11/2011 as does 11 JAN 2011 as does 11 JAN 11 but entering 11012011 does not.
ICONV(DTE,'D') returns 15717
ICONV(DTE,'D2/') returns 19004
ICONV(DTE,'D4/) returns 15717
Is this a bug or does this jibe with your understanding?
Thanks,
Steve
Note that in my test on UniVerse, I did not use NLS or change the local.
My results is as follows:
> RUN BP THEDATE
ENTER THE DATE?01112011
D -
D2/-
D4/-
>.RUN BP THEDATE
ENTER THE DATE?11012011
D -
D2/-
D4/-
I do like the option of using "DI" as mentioned by @Gregor Scott
Hi,
This is for Unidata 8.2.
For years I thought the following was equivalent:
ICONV(DTE,'D')
ICONV(DTE,'D2/')
ICONV(DTE,'D4/)
My assumption was that Unidata did not care about the number or the slash and just did an internal date conversion.
Today I learned that it is not.
While entering 1/11/11 all return 15717 as does 1/11/2011 as does 11 JAN 2011 as does 11 JAN 11 but entering 11012011 does not.
ICONV(DTE,'D') returns 15717
ICONV(DTE,'D2/') returns 19004
ICONV(DTE,'D4/) returns 15717
Is this a bug or does this jibe with your understanding?
Thanks,
Steve
This is for Unidata 8.2.
For years I thought the following was equivalent:
ICONV(DTE,'D')
ICONV(DTE,'D2/')
ICONV(DTE,'D4/)
My assumption was that Unidata did not care about the number or the slash and just did an internal date conversion.
Today I learned that it is not.
While entering 1/11/11 all return 15717 as does 1/11/2011 as does 11 JAN 2011 as does 11 JAN 11 but entering 11012011 does not.
ICONV(DTE,'D') returns 15717
ICONV(DTE,'D2/') returns 19004
ICONV(DTE,'D4/) returns 15717
Is this a bug or does this jibe with your understanding?
Thanks,
Steve
I don't see the results from your testing - just the conversion codes
Sign up
Already have an account? Login
Welcome to the Rocket Forum!
Please log in or register:
Employee Login | Registration Member Login | RegistrationEnter your E-mail address. We'll send you an e-mail with instructions to reset your password.