How to receive and send data from ICF AS400 file in VB, C# or C++

We have to make a program in windows to comunicate with an existing RPGLE program in AS400, this program uses an ICF file.
I know there are better ways to do this, but this is an existing program and we need to send a receive data from Windows through an AS400 ICF file.
Can you share an example in VB, VB .Net, C# or C++?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I haven't thought about this at all yet, so I don't have a suggested solution for the question that you asked. I'll try to look into it later.

However, the first thought that came to mind was to create a "proxy" program on your AS/400. Route the ICF communication back into the same AS/400 into the new "proxy" program. It could do ICF I/O as middleware with sockets on the other side of the proxy to your VB, C# or C++ programming.

Just a brainstorming thought.

mrangelahumadaAuthor Commented:
Thanks Tom,

We already have a solution as you suggested and it works well, but we need to avoid adding variables to the environment.

We have a windows based middleware that establishes links between many platforms, it allows us to consolidate the different platforms we have.

That's why we need to send data and receive data between the windows based middleware and an AS400 ICF file.


Gary PattersonVP Technology / Senior Consultant Commented:
First of all, from IBM's perspective, SNA (and hence the component protocols like APPN, APPC), is functionally dead as a wire-level protocol.

ICFF (Inter-system Communication Function Files) provide a file-style interface to APPC programming, designed to make APPC communications programs easier to use from file-oriented programming languages like RPG.  So, the fact that the AS/400 program uses and ICF file isn't really very relevant.  The key for you is that you want to write an APPC program from Windows.

Back in 1998, Chris Peters wrote this book.  I edited it for Midrange Computing, and I had a copy lying around that I can't find at the moment.  I am relatively certain that it had a chapter on APPC in VB.  That said, I'm not sure that IBM delivers the required PC libraries for APPC any more, which really raises the bar on this kind of programming task, unless you really have a good grasp of low-level APPC implementation details.

Microsoft has a product, call Host Integration Server (HIS) that, at least in the past offered APPC programming interfaces.  I'm not sure if the latest version of HIS (2010) offers the APPC interfaces or not.  You can find the HIS documentation on the MSDN web site.  There is an open standard API called CPI-C that can be used for APPC communications.  MS HIS implements this API.

IBM supplies a Java implementation of CPI-C as part of their Personal Communications product, and used to supply it as part of SecureWay Communications Server, but I don't know if either are available any more.  Haven't had to do any CPIC/APPC/ICF coding for a long time.

I like Tom's idea of  proxy or gateway program.  Write an AS/400 RPG (or whatever) program that uses ICF to interface with your existing ICF application.  You might even be able to harvest code from the existing application's partner transaction program.  Then fit whatever interface you like onto the other end of this new program: TCP sockets, data queue, MQ series, JMS, database file import/export, etc:

Existing RPGLE Application
Sockets / Data queue / MQ / JMS
Windows Program

Note that it is very easy to use an AS/400 data queue from both RPG (QSNDDTAQ and QRCVDTAQ API) RPGLE and from VB, VB.NET, and C#.NET.  MS Supplies a Data Queue API in HIS, and IBM supplies a (Free!) data queue interface in JTOpen (Java Toolbox) and as part of the IBM Access for i (Client Access the us old-timers) program that ships with every AS/400.


- Gary Patterson

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Gary PattersonVP Technology / Senior Consultant Commented:

Experts Exchange Solution brought to you by ConnectWise

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Do you already have Windows APPC capability?

mrangelahumadaAuthor Commented:
Thanks Gary,

This is the solution we need, I'm going to order the book immediately.

Kind regards,

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.