Hi Williams,
         What Simon has stated is correct. This is the issue with the
internal interpretation of dates in jbase since 31-12-1967 midnight. However
a little change in the code helped arrive at the correct result.

    PROGRAM TEST.DATES

    $INCLUDE GLOBUS.BP I_COMMON

    $INCLUDE GLOBUS.BP I_EQUATE



    CALC.DATE = '20101102'

    CALC.DATE=ICONV(CALC.DATE,'D')

    DAY.STR = OCONV(CALC.DATE,'DWA')

    PRINT DAY.STR

    STOP




*OUTPUT:*

Object TEST.DATES cataloged successfully

TEST.DATES

TUESDAY

Hope this helps.

Cheers,
Harish

On Wed, Nov 10, 2010 at 5:16 AM, Simon Verona <[email protected]>wrote:

> I think it's not reading the number as a literal external date but an
> internal date - 20101102 days after Dec 31, 1967.
>
> I'm not going to work out what the actual date is, but I'm sure that will
> be the issue ... Try replacing with 11/02/2010 (or 02/11/2010 if not in the
> US)
>
> Regards
>
> Simon
>
> =========================
> Simon Verona
> Director
> Dealer Management Services Ltd
>
> T: 0845 686 2300
>
> Sent from my iPhone
>
> On 9 Nov 2010, at 20:57, Williams <[email protected]> wrote:
>
> I need help regarding the piece of code below:
>
>     SUBROUTINE TEST.DATES
>     $INSERT I_COMMON
>     $INSERT I_EQUATE
>
>     CALC.DATE = '20101102'
>     DAY.STR = OCONV(CALC.DATE,'DWA')
>     PRINT DAY.STR
>
> END
>
> The system returns SUNDAY. I expect this to be TUESDAY because 20101102 is
> Tuesday.
>
> Anybody with idea please.
>
>  *Williams*
>
>  --
> Please read the posting guidelines at:
> <http://groups.google.com/group/jBASE/web/Posting%20Guidelines>
> http://groups.google.com/group/jBASE/web/Posting%20Guidelines
>
> IMPORTANT: Type T24: at the start of the subject line for questions
> specific to Globus/T24
>
> To post, send email to <[email protected]>[email protected]
> To unsubscribe, send email to <[email protected]>
> [email protected]
> For more options, visit this group at
> <http://groups.google.com/group/jBASE?hl=en>
> http://groups.google.com/group/jBASE?hl=en
>
>  --
> Please read the posting guidelines at:
> http://groups.google.com/group/jBASE/web/Posting%20Guidelines
>
> IMPORTANT: Type T24: at the start of the subject line for questions
> specific to Globus/T24
>
> To post, send email to [email protected]
> To unsubscribe, send email to [email protected]
> For more options, visit this group at
> http://groups.google.com/group/jBASE?hl=en
>

-- 
Please read the posting guidelines at: 
http://groups.google.com/group/jBASE/web/Posting%20Guidelines

IMPORTANT: Type T24: at the start of the subject line for questions specific to 
Globus/T24

To post, send email to [email protected]
To unsubscribe, send email to [email protected]
For more options, visit this group at http://groups.google.com/group/jBASE?hl=en

Reply via email to