Subject: | |
From: | |
Reply To: | |
Date: | Wed, 22 Dec 1999 18:43:30 -0500 |
Content-Type: | text/plain |
Parts/Attachments: |
|
|
I prefer:
DEF Y2KSPLIT NUM*8 = NCO(GETSYSTEMVAL("HPSPLITYEAR")+"0101")
DEF Y2K DATE CEN INC &
= ADDC(YOURNUMDATE,19) IF YOURNUMDATE GE Y2KSPLIT &
ELSE ADDC(YOURNUMDATE,20) IF YOURNUMDATE GT 0
DEF Y2KC CHA*8 = ASC(Y2K,8)
Not sure of the name of the HP variable without logging on to work.
Peter Chong wrote:
>
> Hi, John
> Hi, John
>
> Make field num*8 and
>
> Def Y2k num*8 = (20000000 + YourNumDate) if YourNumDate < 800000 else &
> (19000000 + YourNumDate)
> Def y2kC char*8 = asc(y2k,8)
>
> this will work until year 2079, I think
>
> Merry Christmas & Happy New Year
>
> Peter Chong
> Sr. ERP/MRP Analyst.
> 714.956.9200 x 363
> Web: www.powerparagon.com
>
> >>> John Dunlop <[log in to unmask]> 12/22/99 08:18AM >>>
> I have recently discovered a small y2k glitch with Powerhouse although
> it is more of a programming style problem. Yes, it should have been
> caught before this and possibly other people are well aware of it but it
> got me so I thought I would share it just in case. It probably applies
> mostly to countries outside the US using the dd/mm/yy system and it
> occurs when using the SYSDATE assigned to a numeric or DATE field which
> is then translated into an ascii variable and the month, day and year
> sections split out. The problem occurs if the ascii function is used
> without specifying the ,6 parameter to ensure that 6 characters are used
> in the character variable (e.g. zerofilled). For values such as "991230"
> etc. the value is not a problem. But for "000101" or dates after that
> point, the numeric value gets reduced to "101", e.g. no leading zeroes
> and the result is that the date manipulation function ends up with
> nonsensical values. This came to light because of a screen which
> constructed a jobstream and then used the STREAM command with a DATE=
> parameter. As I said, as long as the character variable is zerofilled,
> the problem does not occur.
>
> Cheers,
>
> John Dunlop
>
> E-mail : [log in to unmask] "If at first you don't succeed...
> Web : http://www.hp3000links.com Don't take up sky-diving !"
> "All your HP3000 resources on the Net"
> Mirror: http://homepages.tcp.co.uk/~jdunlop
>
> ------------------------------------------------------------------------
>
> Peter Chong [log in to unmask]
> 2533
>
> Peter Chong
> 2533 [log in to unmask]
> Work: 363*162
> Additional Information:
> Version 2.1
> Last Name Chong
> First Name Peter
|
|
|