Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling RPG Prgram from VB

Status
Not open for further replies.

Shihab71

Programmer
May 15, 2003
7
AE
Hi all.

I need some help on how to call a RPG program through my VB application, passing a single string parameter.

At this point I do not need a return value.
I am using VB 6.0, connecting to AS/400 via Client Access Express.

Thanks in advance.
 
Can you run the rpg program from a dos command line? If you can you could always use the shell command. If you're looking to access the mainframe you might have to look at using sendkeys or there is a dll called pushkeys (can be found using google)
 
We use the FTP QUOTE command to call jobs on the AS/400. In this example FTP is handled by an ActiveX FTP control from Mabry as Ftp1. Here we're uploading a file, then calling a job to process it.
Code:
strQuoteCmd = "rcmd SBMJOB CMD" & _
              "(CALL PGM(FDL596)) " & _
              "JOB(FDL596) " & _
              "USER(" & strUserID & ") " & _
              "JOBD(QGPL/USRJOBD) " & _
              "CURLIB(ACSPRDDTA) " & _
              "INLLIBL(*JOBD) " & _
              "JOBQ(QGPL/QBATCH)"

With Ftp1
    .Connect
    .PutFile strSourceFile, "ACSPRDDTA/FDP576W.FDP576W"
    .Quote strQuoteCmd
    .Disconnect
End With
 
Thanks for ur assistance.

TomKane, I cannot run from the DOS mode so no luck there.

JBradley, I tried out your option and it works beautifully. I got the ActiveX control from Mabry. The only problem is that our FTP ports are routinely blocked due to security reasons. Don't ask why but that's the way it is. So I am still working on the option of connecting to the AS/400 machine and doing a remote call.

Awaiting any new inputs.
 
Can you try creating an account on the AS/400 specifically to perform the operation you need and allow FTP access for just that user?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top