I just completed a nice example of integrating IBM i system commands with Python when you have a need to update your system time. The IBM i has a built in time sync, but in my case some of the firewalling services I used get in the way so I needed a way to update on demand via an NTP time server. And Python didn't disappoint.
Check out this link for the Python code example:
https://github.com/richardschoen/PythonSamples/blob/master/ibmi/ibmintptimeupdate.py
1 comment:
Updating system time on an IBM i (formerly AS/400) using Python isn’t done directly via a Python API. Instead, Python acts as a remote controller to execute system commands on IBM i.
Key Concept
IBM i uses system commands like:
CHGSYSVAL SYSVAL(QTIME) → Change time
CHGSYSVAL SYSVAL(QDATE) → Change date
Python can send these commands via:
SSH (most common)
Telnet (older systems)
APIs (like XMLSERVICE, REST wrappers)
Post a Comment