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

Posted on 2011-05-04
Last Modified: 2013-11-13
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++?
Question by:mrangelahumada
    LVL 26

    Expert Comment

    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.


    Author Comment

    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.


    LVL 34

    Expert Comment

    by:Gary Patterson
    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
    New RPGLE App
    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

    LVL 34

    Accepted Solution

    LVL 26

    Expert Comment

    Do you already have Windows APPC capability?


    Author Closing Comment

    Thanks Gary,

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

    Kind regards,


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
    When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
    The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
    The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now