User bio
404 bio not found
Member since Jun 30, 2016
Replies:

A very informative article. Here are a few things I can add:

By setting the TZ environment variable, one can run an InterSystems process in a time zone different from the system’s local time zone.

I am in Boston (currently Eastern Daylight Time):

$ iris session iris
USER>WRITE $ZDATETIME($HOROLOG,3,1)," Boston = ",$ZDATETIME($ZTS,3,1)," UT"
2024-09-18 12:55:55 Boston = 2024-09-18 16:55:55 UT
$ TZ=America/Chicago iris session iris
USER>WRITE $ZDATETIME($HOROLOG,3,1)," Chicago = ",$ZDATETIME($ZTS,3,1)," UT"
2024-09-18 11:57:22 Chicago = 2024-09-18 16:57:22 UT

You can even dynamically change a process time zone by using the “C” callout feature to call tzset() with the new time zone.

The documentation mentions $ZTIMEZONE for changing timezones, but this only works if both time zones change between summer and winter time at the same time, which occurs in Europe, but nowhere else.

A common problem seen by InterSystems support approximately twice per year is a system that becomes an hour off because it doesn't transition between summer and winter at the correct time. This is almost always the fault of a missing operating system update. We can supply a small “C” program to dump the current time zone rules for Unix, Unix-like, and OpenVMS systems and a PowerShell script for Windows systems.

If you want to wait for a group of child jobs to finish, you can do this with simple (incremental) locks:

Each child begins with:

    LOCK +^JOIN($JOB) SET ^JOIN($JOB)=$HOROLOG

and ends with:

    KILL ^JOIN($JOB) LOCK -^JOIN($JOB)

The parent can test that all the children have finished with:

    LOCK ^JOIN

    IF $DATA(^JOIN)=0 WRITE !,"One of the children died!"

There are lots of ways to expand on this. Add timeouts on the locks. Add a subscript before $JOB in whatever global you use to communicate the process join to have multiple simultaneous process joins. The parent can also look inside the ^JOIN global to diagnose which process died and possibly restart it.

Certifications & Credly badges:
Stuart has no Certifications & Credly badges yet.
Global Masters badges:
Stuart has no Global Masters badges yet.
Followers:
Stuart has no followers yet.
Following:
Stuart has not followed anybody yet.