HP3000-L Archives

November 2000, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Jeanette Nutsford <[log in to unmask]>
Reply To:
Jeanette Nutsford <[log in to unmask]>
Date:
Mon, 6 Nov 2000 15:19:46 -0500
Content-Type:
text/plain
Parts/Attachments:
text/plain (43 lines)
I wrote a COBOL program recently to display various timezones by using the
"HPCIPUTVAR" intrinsic. I was very surprised to find the times did not
change as I expected when New Zealand went onto daylight savings time and
when the USA came off daylight savings time.

Thanks to Walter Murray (HP) I have finally resolved the problem. The issue
is one that everyone should be aware of if you are using the CTIME function
in a C program or the FUNCTION CURRENT-DATE in a COBOL program.

It transpires that the TZ variable must be set with NO trailing spaces
otherwise the function cannot match the Timezone with an entry in the
TZTAB.LIB.SYS file.

This means do NOT do :SETVAR TZ "EST5EDT     " or similar. The final quote
must be immediately after the last letter.

The more probable error (which I experienced) is when setting the TZ
variable from within a program using the CALL INTRINSIC "HICIPUTVAR"... .
The variable's size must be calculated carefully to ensure there will be no
trailing spaces.

You can actually prove this by doing the following -

1. SETVAR TZ "NZST-12NZDT"
2. RUN SHOWCLKS.PUBXL.TELESUP
3. SETVAR TZ "NZST-12NZDT    "
4. RUN SHOWCLKS.PUBXL.TELESUP

This will show 2 different times for New Zealand. By the way, you may have
to change the entry in TZTAB.LIB.SYS for New Zealand as it does not have an
entry for this year (2000). Use Editor to change the 3rd line for
NZST-12NZDT from 1990-1999 to 1990-2038.

I hope this piece of information may save someone else from spending too
long trying to work out why the TZTAB file does not appear to work.

Jeanette Nutsford
<[log in to unmask]>


Phone: 1 301 9122345 (in Maryland, USA from 3 November until 9 November)
            44 1604 471526 (in England from 10 November until 10 December)

ATOM RSS1 RSS2