In order to assist with debugging PSOS scripts the PSOS script step could have a checkbox/flag that specifies return of the execution log of the script.
This execution log would contain data about the state of the session while the script runs:
account name and priv set.
open files and window names.
Logged on user(s) identiry.
Variables and their values.
script steps and any errors.
and timestamps for step run duration would be a huge assist tool.
The execution log should be created as a .log file
This is an alternative for this: