Adding a scheduled job

365 pts.
Tags:
AS/400 job scheduler
AS/400 jobs
Call PGM Command
Job scheduling
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

Answer Wiki

Thanks. We'll let you know when a new response is added.

I do not believe you can add an automatic ENTER key.
But, you can change your program to check to see if it is running in BATCH mode and then ignore the process that requires the ENTER key.

Discuss This Question: 8  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • deepu9321
    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
    3,695 pointsBadges:
    report
  • lorit
    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?
    365 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • lorit
    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?
    365 pointsBadges:
    report
  • Lovemyi
    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
    2,310 pointsBadges:
    report
  • TomLiotta
    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
    125,585 pointsBadges:
    report
  • lorit
    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.
    365 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following