45 pts.
0
Q:
executing a url from the as400
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.
ASKED: Nov 5 2008  3:57 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
2500 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Exactly what what do you mean by "executing a URL"?

STRPCO is the Start PC Organizer - I believe it is a holdover from PC Support. It allows you to execute a command on the PC Client. So yeah, it's not going to work as a batch command on the AS/400...

When you enter a URL into a web browser, the browser makes a request to a web server to send a web page back to the browser. That URL could contain parameters to specify certain things. The combination of URL and parameters could cause the server to do something that doesn't result in any output being sent to the browser - but that is a bit counter-productive..

Since the AS/400 is not a web browser I'm not sure how you could use it to contact a web server via a URL..

You did say that you were sending a file via FTP and then trying to "execute a URL". Are you trying to do something on the FTP server? Could you execute a remote command on the FTP server and have that do whatever it is you are trying to do? You already have the FTP connection open to PUT the file..

Regards
Mike
Last Answered: Nov 6 2008  11:18 PM GMT by Mcl   2500 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Breinhart   45 pts.  |   Nov 7 2008  2:46PM GMT

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

 

Mcl   2500 pts.  |   Nov 7 2008  8:32PM GMT

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

 

Pcatlin   200 pts.  |   Nov 10 2008  4:25PM GMT

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:
 <a href="http://www.scottklement.com/httpapi/" title="http://www.scottklement.com/httpapi/" target="_blank">http://www.scottklement.com/httpapi/</a>

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

 
0