5 pts.
 calling a URL from RPG OR CL
I would like to call a html. page from either a RPGLE or CL program.

Software/Hardware used:
AS400
ASKED: November 2, 2009  5:42 PM
UPDATED: November 5, 2009  2:10 AM

Answer Wiki:
Check out this article: http://systeminetwork.com/article/use-cgi-redirects-launch-long-urls. It requires a membership but i think a free on will work. If not you can get the code from: http://www.pentontech.com/IBMContent/Documents/article/55778_385_OpenUrl.zip
Last Wiki Answer Submitted:  November 2, 2009  9:17 pm  by  Teandy   5,830 pts.
All Answer Wiki Contributors:  Teandy   5,830 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

There are at least two possible meanings from your question:

  1. Most likely — you want a user who calls your program in a telnet emulator session to see a browser open up on his/her PC with a web page that was provided by your program.
  2. Less likely — you want your RPG (or CL) program to connect some web server and read a page from that server. Processing of the HTML would be done in your program.

The most common way to handle the first case is with the STRPCCMD command. Set the environment by running a STRPCO command. Then:

STRPCCMD PCCMD('start http://www.google.com') PAUSE(*NO)

There are some significant limitations and restrictions with STRPCCMD. Be prepared to throw it away and replace it with RUNRMTCMD.

You can get experience with STRPCCMD, but it might not work with your emulator software or you might not like its security implications or you might simply exceed its limits. When/if that happens, you should already be prepared to use RUNRMTCMD (or an alternative such as rexec() or others).

Tom

 109,995 pts.

 

Ah… this blasted editor messed the URL in that STRPCCMD parameter. If you just put the plain google URL in place of [googleurl] in this:

STRPCCMD PCCMD(’start [googleurl]') PAUSE(*NO)

…you should get the idea.

Tom

 109,995 pts.