I have created a job in the AS400 job schedule and I need to execute a url from that job after I FTP a file to a server. I want to execute the url from the AS400 directly, not from a PC or a 5250 emulator session on a PC. When I run the job, I get a error message Command STRPCO not allowed in this setting. I assume that is because I am trying to run the PC command not from a PC. Does anyone know how to execute the url directly from the AS400? Any help is greatly appreciated.
Software/Hardware used:
ASKED:
November 5, 2008 3:57 PM
UPDATED:
November 10, 2008 4:25 PM
Thanks Mike,
What I am trying to do is: I am FTP to a web server to dump a data file to update product availability on our web site for people to purchase. I am dumping this file for update every fifteen minutes. Once I have the file dumped, I am wanting to invoke the URL to update the web server database with the file I just sent. I can call the AS400 CL from my desktop which allows the STRPCO command to work, but when I try to run the CL in a batch job, it does not work. I understand that is because I am not using a PC to invoke the job with an AS400 5250 emulator session. I thought about invoking the URL once i was on the server within the FTP script, but I’m not sure how to code that in the FTP script. Any ideas?
Thanks,
Bob
If I’m understanding you, the URL you invoke will run some process that updates your database from the file you just uploaded.
So, one option..
Can you call that process from a command line on the server?
There is an FTP command called “QUOTE” which allows you to send a command to the FTP server. Of course, it all depends on permissions, paths, etc – but you might be able to call the process via FTP. Google is your friend for help with that.
Another option -
When you upload the file, the properties of the file should indicate when it was changed. It might be possible to set up a CRON job on your web server to check that file – and if the file has changed since the last time it was checked then process the file.
Regards
Mike
Bob..
It sounds like what you want to do is similar to a web services type call… Scott Klement did some neat stuff with that a while back…
Take a look at this web page:
http://www.scottklement.com/httpapi/
You should be able to use this code to have an RPG program attach to the URL on your server, and then receive the return response (just like a browser would) back into a stream file. You can then parse the stream file to review the results of the URL call…
Hope this helps
Phil C