Is this something QIBM_QSH_CMD_ESCAPE_MSG could help with? That’s what I use for my batch jobs.
-----Original Message-----
From: OpenSource [mailto:opensource-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of John Yeung
Sent: Friday, August 02, 2019 1:50 PM
To: IBMi Open Source Roundtable <opensource@xxxxxxxxxxxxxxxxxx>
Subject: [IBMiOSS] How to get Python errors to cause MSGW job status?
Though IBM's Python 3.6 for PASE is a significantly better language overall than iSeriesPython 2.7, there are still some aspects of iSeriesPython that I like better.
One of them is that when an exception occurs in an iSeriesPython program, it registers as a WRKACTJOB-visible error. The error itself isn't particularly informative; it's just "application error" and then you have to dig further. Or maybe the job ends automatically but abnormally. In any event, you get *some* kind of system-level indication that something went wrong.
I've been using Python 3.6 for PASE, and all the jobs end "normally", no matter what. It's been difficult for me to get into the habit of always verifying every single job by looking at the spooled output.
Even if I do eventually get to the point that it's a habit, it's still pretty damn annoying and productivity-sapping.
So, one brainstorming challenge for myself and anyone else who is inclined to think about this is: Can we build a Python calling system that detects Python exceptions and causes MSGW?
I would be remiss if I didn't point out that Richard Schoen's "Python on i" library does at least make it easy for Python output to go to the job log. He deserves credit for what is the current "Cadillac of Python wrappers". But if the job ends normally, how do I know to check the job log? It's essentially the same issue I have now, just that my output goes to spooled files named QPRINT instead of to the job log.
Now, I haven't really dissected Richard's library. Perhaps it could be adapted so that output to stderr triggers an error message or abnormal end.
John Y.
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list To post a message email: OpenSource@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/opensource.
Help support midrange.com by shopping at amazon.com with our affiliate
link:
https://amazon.midrange.com
[
https://www.medtronsoftware.com/img/MedtronMinilogo.bmp] Kevin Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550
Toll Free: 877-893-2550
https://www.medtronsoftware.com
CONFIDENTIALITY NOTICE
This document and any accompanying this email transmission contain confidential information, belonging to the sender that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, or the employee of agent responsible to deliver it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or action taken in reliance on the contents of these documents is STRICTLY PROHIBITED. If you have received this email in error, please notify the sender immediately to arrange for return or destruction of these documents.
As an Amazon Associate we earn from qualifying purchases.