On Thu, Jan 9, 2020 at 2:24 PM Smith, Mike <Mike_Smith@xxxxxxxxxxxxxxxx> wrote:

If I want to run a rpg pgm daily. I can put on job scheduler or on a menu. Etc.
How do I have a regular user run a python program. Can I schedule it?

You can run it or schedule it the same way you would run or schedule
any CL command.

If you don't already have a CLP or CMD wrapper for Python, then your
CL command would be QSH.

For example, earlier you said you ran your script like this:

python3 actchgdt.py 49490 20190101 20190131

From the sound of it, that was not entered at a CL prompt but rather
in Qshell or one of the PASE shells. So, to do that same call from a
CL prompt or in a CLP, you would do

qsh cmd('python3 actchgdt.py 49490 20190101 20190131')

If your Qshell path doesn't include the proper directory, you can
specify it on the call:

qsh cmd('/QOpenSys/pkgs/bin/python3 actchgdt.py 49490 20190101 20190131')

Eventually, you'll probably want to wrap it up in a CMD. Richard
Schoen has a fairly full-featured one:


I have one for myself which is much simpler (besides the QSH command,
it sets a couple of environment variables).

Can I connect to my sql server?

If your IBM i can connect to it, then you should be able to use Python
from PASE to connect to it.

John Y.

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].