I enter a job schedule entry for 2am on sunday morning that will run this code. This is some very basic code that will change the time forward or backward based on the time of the year it's run. I offer no gaurentees. This is offered as my opinion only and it is not the recommendation of me or any of my employers. I don't suggest that you run this code, this is just an example of code that would change the time on the AS400 that it run on. If you're not sure, check with someone who is familiar with your environment before making this change. In any case, don't do this on your own! As someone else mentioned, you should adjust the UTC offset system value. You could add that change to this routine. PGM DCL VAR(&TIMEN) TYPE(*DEC ) LEN(6 0) DCL VAR(&MONTHN) TYPE(*DEC ) LEN(2 0) DCL VAR(&TIMEC) TYPE(*CHAR) LEN(6) DCL VAR(&MONTHC) TYPE(*CHAR) LEN(2) /*assuming the month is set correctly */ RTVSYSVAL SYSVAL(QMONTH) RTNVAR(&MONTHC) CHGVAR VAR(&MONTHN) VALUE(&MONTHC) /*assuming the time is correct now*/ RTVSYSVAL SYSVAL(QTIME) RTNVAR(&TIMEC) /**/ CHGVAR VAR(&TIMEN) VALUE(&TIMEC) /* SPRING AHEAD /**/ IF COND(&MONTHN < 6) THEN(CHGVAR VAR(&TIMEN) + VALUE( &timeN + 10000 )) /* FALL BACK /**/ IF COND(&MONTHN > 6) THEN(CHGVAR VAR(&TIMEN) + VALUE( &timeN - 10000 )) /*get ready to change */ CHGVAR VAR(&TIMEC) VALUE(&TIMEN) /* actual change /**/ CHGSYSVAL SYSVAL(QTIME) VALUE(&TIMEC) /**/ /* get out */ RETURN ENDPGM +--- | 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: firstname.lastname@example.org +---
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.