×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

RPGLE or /Free (URL Call)

RPGLE or /Free (URL Call)

RPGLE or /Free (URL Call)

(OP)
Is there a way to call up a URL directly from RPGLE or /free?

RE: RPGLE or /Free (URL Call)

Yes, you need to write a CL program:

CODE

             PGM        PARM(&WEBSITE)                                 
             DCL        VAR(&CALL) TYPE(*CHAR) LEN(123) VALUE(' ')     
             DCL        VAR(&WEBSITE) TYPE(*CHAR) LEN(89)              
             STRPCO                                                    
             MONMSG     MSGID(CPF0000 IWS0000)                         
             CHGVAR     VAR(&CALL) VALUE('rundll32 +                   
                          url.dll,FileProtocolHandler' *BCAT &WEBSITE)
             STRPCCMD   PCCMD(&CALL) PAUSE(*NO)                        
             MONMSG     MSGID(CPF0000)                                 
             ENDPGM                                                    

Then call the program from your RPG with the URL you want to open.
 

-- Francis
I'd like to change the world, but I can't find the source code.

RE: RPGLE or /Free (URL Call)

(OP)
First....thank you.

I put in the below to test the CL.  I am receiving the following error:
Error in URL.DLL
Missing entry: FILEPROTOCOLHANDLER

Any ideas?

CODE

PGM                                                       
DCL        VAR(&CALL) TYPE(*CHAR) LEN(123) VALUE(' ')     
DCL        VAR(&WEBSITE) TYPE(*CHAR) LEN(89) +            
             VALUE('HTTP://WWW.YAHOO.COM')                
STRPCO                                                    
MONMSG     MSGID(CPF0000 IWS0000)                         
CHGVAR     VAR(&CALL) VALUE('RUNDLL32 +                   
             URL.DLL,FILEPROTOCOLHANDLER' *BCAT &WEBSITE)
STRPCCMD   PCCMD(&CALL) PAUSE(*NO)                        
MONMSG     MSGID(CPF0000)                                 
ENDPGM                                                    

RE: RPGLE or /Free (URL Call)

Case matters for the command in quotes. The AS/400 is not case-sensitve, but Windows is.

Also, I copied the wrong code - my mistake.

This one works:

CODE

             PGM        PARM(&WEBSITE)                             
             DCL        VAR(&CALL) TYPE(*CHAR) LEN(123) VALUE(' ')
             DCL        VAR(&WEBSITE) TYPE(*CHAR) LEN(117)         
             STRPCO     PCTA(*NO)                                  
             MONMSG     MSGID(IWS4010)                             
             CHGVAR     VAR(&CALL) VALUE('start' *BCAT &WEBSITE)   
             STRPCCMD   PCCMD(&CALL) PAUSE(*NO)                    
             MONMSG     MSGID(CPF0000)                             
             ENDPGM

If I compile it and call it like this:

CODE

CALL PGM(FMLLIB/RUNWEB) PARM('http://www.tek-tips.com/viewthread.cfm?qid=1565565')
  

then I get this web page.                                 

-- Francis
I'd like to change the world, but I can't find the source code.

RE: RPGLE or /Free (URL Call)

Aso, in SEU, type SET CAPS OFF so that when you paste the code, it won't force it to upper case.

-- Francis
I'd like to change the world, but I can't find the source code.

RE: RPGLE or /Free (URL Call)

(OP)
Perfect..thank you!!!

One more quick question, does this only work with Client Access?  Our overseas manufacturers use MochaSoft.

 

RE: RPGLE or /Free (URL Call)

It doesn't matter what your emulator is. Client Access is not required. I'm using Rumba here. Just to be safe, make sure the other system has the STRPCO command.  

-- Francis
I'd like to change the world, but I can't find the source code.

RE: RPGLE or /Free (URL Call)

Not sure that STRPCCMD works under Mosha ... even if PCO.exe (STRCPO) is installed and started on the Windows side (I am in doubt.)
Also

CODE

CHGVAR     VAR(&CALL) VALUE('rundll32 url.dll,FileProtocolHandler' *BCAT &WEBSITE)
STRPCCMD   PCCMD(&CALL) PAUSE(*NO)

should work though.

RE: RPGLE or /Free (URL Call)

Mercury,

It didn't work for me (using the example I first posted), which is why I also posted the second one using PCO.

-- Francis
I'd like to change the world, but I can't find the source code.

RE: RPGLE or /Free (URL Call)

Quote (Oche):


does this only work with Client Access?

Quote (flapeyre):


It doesn't matter what your emulator is. Client Access is not required.
I tried it on a PC where I have only tn5250 and no iSeries Navigator installed and it doesn't work.
I got an error:

CODE

Required PC program (PCO.EXE) is not active
No communications with PC can occur
 

RE: RPGLE or /Free (URL Call)

To All,

Well if you do not use Client Access STRPCO/STRPCCMD won't work.

Look here.

Side note -- This forum is among the worst to edit posts.
 

Philippe

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close