PxPlus User Forum

Main Board => Discussions => Language => Topic started by: John_S on December 04, 2019, 02:03:13 PM

Title: INPUT in a cron job
Post by: John_S on December 04, 2019, 02:03:13 PM
Hello.

We run numerous PxPlus cron jobs on our RedHat server, and many of those programs can also be run on-demand in a regular session. Some of these programs have INPUT statements, and while we try to program them to skip INPUT statements when the user is "batch", we sometimes miss some of them.  This causes the cron process to hang, and it even appears to slow the system down.

Is there a system parameter that would issue a RELEASE if an INPUT statement is encountered in a cron job?  I figure the answer is No, and I don't even know how it would know it is a cron job, but my associate wanted me to post the question.

PxPlus 14.10.

Thanks!
Title: Re: INPUT in a cron job
Post by: Ken Sproul on December 04, 2019, 04:49:48 PM
I believe a background process will quit when it hits an input statement if there is no "input" file/device associated with it.  If you are not redirecting input to /dev/null (i.e. < /dev/null), see if that helps.
Title: Re: INPUT in a cron job
Post by: John_S on December 04, 2019, 04:58:58 PM
Thanks Ken.  I will pass this on to my associate.
Title: Re: INPUT in a cron job
Post by: Mike King on December 04, 2019, 05:22:55 PM
Ken is correct. 

When running in background you should redirect terminal input to something like </dev/null and your application will need to deal with an END-OF-FILE error should it attempt to read from channel 0. 

If desired you can redirect input from a file which has pre-determined responses -- but I doubt that is what you want or need.
Title: Re: INPUT in a cron job
Post by: John_S on December 04, 2019, 05:29:46 PM
Thanks Mike!