Hello,
I'm guessing by the mention of the 123 limit that when you say "open a
URL" you mean you want to run a remote command to launch a web browser
from a green-screen session.
In V7R2, IBM increased the limit from 123 to 1023. Will that work for
you? If so, that is certainly the easiest solution.
If you're stuck on an old release -- well, since V7R1 support is ending
soon, I really hope youre not! But... if you are, there are a bunch of
ways to work around the limit.
One way is to build a batch file with multiple PC Commands. You can set
a variable with up to 123 characters, then in the next line add to the
variable, etc, until you get everything you need, then write the command
to start the browser with your variable as a parameter. In this way,
you use multiple PC commands that combine to make one longer URL. The
disadvantage to this is that it can be really difficult to properly
escape any special characters in the URL.
Another way is to use a URL shortening tool. There are public ones like
tinyurl.com of course, but maybe better is to write your own that runs
on the IBM i. That way the program that wants to launch the URL can
simply write the long URL to a database field, and then call the URL
shortner which redirects to the longer URL.
I've written articles about both of these techniques that I'm sure are
out there on the Internet somewhere. You can Google for them -- if you
can't find them, let me know.
Finally, another solution is to use a different tool instead of
STRPCCMD. IBM provides RUNPCCMD as well, which works -- but is
cumbersome to set up and make secure. Aaron Bartell has one that he
wrote that involves installing/running a program on each PC that works
nicely and might be an option for you, too... another thing you can Google.
Honestly it's hard to answer this question because there are so many
possibilities, and it's extremely time consuming to try to list them all
and do them justice... so I'm going to stop at the 4 suggestions I've
already provided. Hope they're useful!
On 6/22/17 7:46 PM, Programador IBMi wrote:
Hi guys,
I Need to open an url from a rpgile program, need some instruction and to
know how to fix the 123 limitation ir the url is longer than 123.
Hope you can help me,
Best Regards,
As an Amazon Associate we earn from qualifying purchases.