|
DAYSAVTIM: PGM
/******************************************************************************/
/* NAME - DAYSAVTIM */
/* FUNCTION - Perform automatic Daylight Savings Time adjustments. */
/* */
/* NOTE - Program should be compiled with USRPRF(*OWNER), and */
/* the owner should have authority to CHGSYSVAL QHOUR */
/* - OR - */
/* the Job Schedule entry should name a USER that has */
/* authority to CHGSYSVAL QHOUR. */
/* */
/* ===>>> Date of last mods. : 1999/06/25 */
/* */
/* Taken from: Midrange Computing, December 1997, page 13. */
/* (from David Hummell, modification of program by Lori
Nesje) */
/* Further mods by Neil Palmer, DPS Canada Ltd. */
/* */
/* Add to system job scheduler as follows (substitute valid USER): */
/* ADDJOBSCDE JOB(AUTO_DST) CMD(CALL PGM(QGPL/DAYSAVTIM)) + */
/* FRQ(*MONTHLY) SCDDATE(*NONE) SCDDAY(*SUN) + */
/* SCDTIME(020000) RELDAYMON(1 *LAST) + */
/* JOBQ(QSYSNOMAX) USER(????) TEXT('Daylight + */
/* Savings Time adjustment program') */
/* */
/******************************************************************************/
DCL &MONTH *CHAR 2
DCL &DAY *CHAR 2
DCL &HOUR *CHAR 2
DCL &HOUR# *DEC (2 0)
DCL &UTCOFFSET *CHAR 5
DCL &UTCOFFSET# *DEC (5 0)
RTVSYSVAL QMONTH &MONTH
RTVSYSVAL QDAY &DAY
RTVSYSVAL QHOUR &HOUR
RTVSYSVAL QUTCOFFSET &UTCOFFSET
CHGVAR &HOUR# &HOUR
CHGVAR &UTCOFFSET# &UTCOFFSET
IF (&MONTH = '04' *AND &DAY < '15') THEN(DO)
CHGVAR &HOUR# (&HOUR# +1)
CHGVAR &UTCOFFSET# (&UTCOFFSET# +100)
ENDDO
IF (&MONTH = '10' *AND &DAY > '15') THEN(DO)
CHGVAR &HOUR# (&HOUR# -1)
CHGVAR &UTCOFFSET# (&UTCOFFSET# -100)
ENDDO
IF ((&MONTH = '04' *AND &DAY < '15') *OR +
(&MONTH = '10' *AND &DAY > '15')) THEN(DO)
CHGVAR &HOUR &HOUR#
CHGSYSVAL QHOUR &HOUR
IF (&UTCOFFSET# > 2400) +
CHGVAR &UTCOFFSET# (&UTCOFFSET# - 2400)
IF (&UTCOFFSET# < -2400) +
CHGVAR &UTCOFFSET# (&UTCOFFSET# + 2400)
IF ((&UTCOFFSET# < -45) & (&UTCOFFSET# > -100)) +
CHGVAR &UTCOFFSET# (&UTCOFFSET# + 40)
IF ((&UTCOFFSET# > 45) & (&UTCOFFSET# < 100)) +
CHGVAR &UTCOFFSET# (&UTCOFFSET# - 40)
CHGVAR &UTCOFFSET &UTCOFFSET#
IF (&UTCOFFSET# >= 0) THEN(CHGVAR +
&UTCOFFSET ('+' *CAT %SST(&UTCOFFSET 2 4)))
CHGSYSVAL QUTCOFFSET &UTCOFFSET
ENDDO
ENDPGM
Neil Palmer DPS Data Processing Services Canada Ltd.
50 Acadia Avenue, Ste.102 AS/400~~~~~
Markham, Ontario, Canada. ____________ ___ ~
Phone:(905) 474-4890 x303 |OOOOOOOOOO| ________ o|__||=
Cell.:(416) 565-1682 x303 |__________|_|______|_|______)
Fax: (905) 474-4898 oo oo oo oo OOOo=o\
mailto:NeilP@DPSlink.com ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://www.DPSlink.com iSeries 400 The Ultimate Business Server
"Haase, Justin C." <Justin.Haase@Kingland.com>
Sent by: owner-midrange-l@midrange.com
2001/03/30 12:11
Please respond to MIDRANGE-L
To: "'MIDRANGE-L@midrange.com'" <MIDRANGE-L@midrange.com>
cc:
Subject: Daylight Saving Change
With the change coming up Sunday AM, does anyone know of a quick-easy-done
way to change our clocks? On V4R4, you couldn't use a JOBSCDE to change
the
hour of the day, going to test on V4R5 within the hour. It's got to be
something simple - any ideas? Or possible CL code we could use? Need to
change UTC offset backward and the hour forward. I'm not a programmer or
I'd try myself. I can cut and paste and compile tho. Any help would be
great.
PS - Is Nick Mart still on this list?
Justin C. Haase
Midrange Systems Engineer - Kingland Systems Corporation
+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.