Using the WRKJOBSCDE command I am asking it to run this program
CALL PGM(TAXNCY/TC350R) - The problem is once this program is called, you have to hit enter to excute the program. How do I add this to my command? Thanks,
Software/Hardware used:
AS400
ASKED:
June 7, 2011 12:36 PM
UPDATED:
June 17, 2011 8:52 PM
The problem is once this program is called, you have to hit enter to excute the program.
Can you clarify what that means? Are you saying that the program itself displays a prompt that must be responded to by pressing <Enter>?
What does the prompt look like? If it is a ‘Display Program Messages’ display, it might be possible to automate a response. Or a response might be supplied through the QSYSOPR message queue.
However, if a program is written to interact with a person, then it’s not a good candidate to run through a scheduler. Some code changes might be called for.
Tom
So, How do you scheduling the job? by using SBMJOB? If yes you can mention the schedule date and time there.
Are you still need to give enter for running the job(in WRKJOBSCDE even after schedule date & time reached)?
If yes, Will you post a piece of your CL code here. That would be fine for understanding the actual problem.
Pradeep
I am a beginner here – when I type this command on the command line CALL PGM(TAXNCY/TC350R) it takes me to an input screen where it defaults to todays date – then I hit enter and it runs the report for me. I’m trying to automate this program to run everyday. I thought I would use the Job Schedule – the program is you have to hit enter to make it run – any way I can get this program to run everyday on its own?
I am a beginner here – … I thought I would use the Job Schedule – the program is you have to hit enter to make it run – any way I can get this program to run everyday on its own?
Unfortunately, almost certainly not.
While there are some technical possibilities, even well experienced developers could have difficulty getting such a program scheduled.
There are some possibilities, though, depending on exactly what is happening.
First, are you sure that the same program that prompts for the date is also the program that prints the report? Often, a ‘prompt’ program merely issues a prompt screen and then CALLs a second program that does the reporting. The value that was entered on the prompt screen is passed into the second program as a parameter. If that’s the case, then you really want to schedule the internal program rather than the one that you are calling now.
Second, programs are often written to run two different ways — interactively as you’re doing it now and in “batch” as you would like to do it. Programs like those will check their environment first. If they find themselves running interactively, they’ll issue the prompt and wait for a reply. If they’re running in batch, they will retrieve the needed value from some other source or perhaps simply use a default such as “today’s date”. If that’s the case, then you’ll need to determine what the behavior of the program is when it’s running in batch mode.
After you press <enter>, does it take more than a few seconds to create the report? Are you notified in any way that the report is ready?
Tom
I’m not notified when the report is finished – it writes directly to a file and not a spool file. When I manually run the report I have to add the “L” or “J”. Is there a way I could edit the program have it run daily without user intervention?
If you use a third party back office suite like Help Systems with their Robot Scheduler and Replay products then you can just teach the batch job through Replay trapping the key strokes and then play them back in the Robot Scheduler. These are the only tools I know of that can replicate interactive jobs in a batch environment unless you write your own.
If you have a lot of interactive jobs to schedule to batch then I suggest you look at these products
Lovemyi
Is there a way I could edit the program have it run daily without user intervention?
If you have access to the source code that was used to compile the programming, then, yes, it can be modified. Whether that’s a feasible option or not is a very different question.
As Lovemyi mentioned, there are commercial products that can handle interactive programs in batch environment. [Disclaimer: the company I work for is owned by Help/Systems, the vendor of the Robot Scheduler and Replay products.]
Products wouldn’t have much success if the cost of “doing it yourself” wasn’t relatively expensive. That might give an idea of some degrees of difficulty in many such projects. But note that “modifying programming to run in batch” is not the same as “causing an interactive program to run in batch”.
Tom
Thank you everyone. I’m going to check out Help Systems – in addition to getting this to run on its own, I need it to be uploaded to an FTP as well. Thanks again.