call AS/400 program from ASP.Net

K

Kusno Doang

Dear all,

In our AS400 system, there is a program, 'PrgSend" located in MyLib library.
That program only reads from PF file that comes from FTP, "TMPData" and sends data to Real table.

I have the menu program with this command :

0001 RUNQRY *N TMPData
0002 call PrgSend
0003 WRKSPLF SELECT(*CURRENT *ALL *ALL PrgSend)
0009 s

In .Net, I only want call PrgSend to read PF file.
I create looping in a folder to read CSV files, than send those files use FTP and go to TMPData.
After that, .Net call PrgSend to send TMPData to Real table.

I tried these code in .Net :

Dim AS400Name As String = "110.114.30.02"
Dim AS400User As String = "AMIN"
Dim AS400Password As String = "Password"
Dim AS400Pgm = "PrgSend"
Dim AS400Lib = "MyLib"

Dim AS400 As New cwbx.AS400System
Dim program As New cwbx.Program

AS400.Define(AS400Name)

program.system = AS400
program.system.UserID = AS400User
program.system.Password = AS400Password

program.LibraryName = AS400Lib
program.ProgramName = AS400Pgm

AS400.Signon()
AS400.Connect(cwbcoServiceEnum.cwbcoServiceRemoteCmd)
program.Call()

But doesn't work. It was draweed in this code : AS400.Define(AS400Name)

So, could anyone help me to solve the problem ?

Thanks and Regards,

Kusno.
 
J

Jeff Johnson

But doesn't work. It was draweed in this code : AS400.Define(AS400Name)

Could you rephrase that last statement? I don't understand it at all.

And what is the Define() method supposed to do?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top