Link to home
Start Free TrialLog in
Avatar of ocean123
ocean123

asked on

call a AS/400 CL within a VB

I would like my VB program to execute an AS/400 CL.  The user will click on a command button that will call this CL.  This CL will copy a file to another file using CPYF. Our legency system is on AS/400.  
ASKER CERTIFIED SOLUTION
Avatar of JH0401
JH0401

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rzweifel
rzweifel

You can use ftp to call the CL program:

1) Create a file ftpfile.ftp:
open 10.1.1.1
USERNAME
PASSWORD
quote rcmd CALL PGM(MyLib/MyCLProgram)

Enter the correct IP address of you AS400 instead of 10.1.1.1 and a valid user name and password. MyLib is the AS400 library and MyCLProgram the name of the CL program to run.

2) Create a batch file that calls the ftp file above:
ftp -s:C:\ftpfile.ftp

Enter the correct path your your ftp file.

3) Call the above batch file from your VB program using a Shell command.

There may a nicer solution but I used this one before and it works.
Avatar of ocean123

ASKER

thanks for the help; I used ODBC for my connection