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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Socket communication to AS400 1

Status
Not open for further replies.

ladeecroft

Programmer
Oct 6, 2003
19
PH
Hi there!

I'm trying to send and receive data to our AS400 through a VB pgm. I've checked our AS400, it's using Telnet to communicate through Client Access with 5250 emulator.

I've seen codes that have used winsock control but i still dont have any idea on how this control could communicate (send and receive data) to AS400 just by defining the Remote Host and its corresponding port. Is it through the socket? Do you think i still need to create a socket server program?

In AS400, i've seen an application program that receives a parameter from the front end. This application program is triggered everytime the Finance job is submitted to batch (SBMFNCJOB). This CL command uses a device table and a program table. And all the request from the devices specified in the device table are received by this application program specified in the Program table. I understand what happens once the application pgm is triggered, what i dont get is how does it receives the requests from the front end (front end is using Consumer Transaction (CT)language).Based on what you've said, it's possible for VB to connect to AS400, sytem to system..how do i do this?

Im really confused, it's too technical for me.




 
I am not sure exactly what do you want to accomplish. But in addition to the sockets programming, perhaps these are something you can consider:
1. Access AS/400 data from vb, simply use odbc or oledb in the vb.
2. Access from rpg program to SQL server, etc., then setup the remote host and embedded the sql CONNECT statement in your rpg program to connect it, and then open the remote file. Please refer it to IBM's SQL manual for Iseries.
3. If you want your RPG program to be evoked by a pc client, with parameter passed to it, you may want to consider setup the http server in your AS/400. I use web page as front end and net.data as CGI program and RPG program on the server side. It works great. Here is the net.data forum
Hope this helps.
Jerry Tseng
 
thanks jerry, glad to hear from you again.

as of this moment, i was able to find a document with regards to socket programming, vb on the client side and ile-rpg on the server side. With the use of socket APIs, im hoping to connect my front end system to the backend.
I'm still in the process of absorbing everything in the paper i've found in techtarget.com .

Anyways, if it would make any diff now, we're planning to purchase a software that will be running on a pc as front end, but it needs data from the backend (AS400) and this software will sometimes update the files in the backend. This is where i come in. I need to find a way wherein i could send and receive data to AS400 without using ODBC, the requirement clearly states that the connection should be directly made through the IP address without directly accessing the files in the backend.

With the socket APIs, i'm planning to send transaction request from the client side, and then, receive these requests in the server side, and perform the retrieval or updating of files in the backend, and then just send back the response from the backend to the client side through socket APIs also.

but i'll still check the forum you've mentioned. hope i could make it to my deadline...
 
Here is a link to a utility that includes the VB, JAVA, and RPG code for using Data Queues and Sockets for passing data between the AS/400 and a PC.


Here's what you'll get when you download this tool:

Two AS/400 CMD source members (one for using Sockets, the other for using Data Queues.
Two AS/400 RPGIV source members (one for using Sockets, the other for using Data Queues.
Two Java source files (one uses Sockets, the other uses Data Queues).
A Visual Basic Project (includes all source) so that you can modify the VB Socket example if you want to.
A Compiled Visual Basic executable file that you can begin using immediately, in case you don't want to or don't know how to modify code.

When I downloaded it and tried it out it was missing a Java component but I emailed the author and he sent it to me, hopefully he has updated the download to include the missing file. It worked great. I too was looking for examples of ways to get data passed between an AS/400 and a PC without using ODBC.


T. Bishop
 
Message for T. Bishop

I went to the site you snap-ebooks but the AS/400 Code is no longer available there.

I was wondering could you let me know what the AS/400 code is please. I would be very grateful for this many thanks.

If not, could you tell what exactly the data queue contents should look like. "123.156.425.xxx" "C:\WINNT\NOTEPAD.EXE"

Thanks
Sean
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top