I suppose you could call iSeries Access functions on the PC to determine if a 5250 session was started. If one was not, then start one. Once a session was started, retrieve its presentation space and figure out a path to command line from whatever was on the screen. Then update the presentation space to manipulate it to get to a command line. Then enter the CALL command on the command line and execute it.
Technically, almost any telnet function could be used. It wouldn’t have to be an iSeries Access session. In a pinch, you could study the telnet protocol and use sockets to do it all yourself. If you can’t do that, then any product that allows access to the telnet session presentation space for both reading and writing to the display buffers could work. It can be 5250, 3270 or VT100 or later.
But the idea of calling a subfile program outside of a terminal session is a bad one to start with. There is never a need to do it. Just call a program that returns the same data in batch. Forget calling a subfile program. Subfiles are specifically a part of 5250 display stations. (Translation to 3270 and VT100 is done by the system.)
A subfile program shouldn’t do anything but presentation. ASP,NET has its own presentation methods. It doesn’t use subfiles. So instead of calling the subfile program, call the same routines that the subfile program calls; and use ASP.NET to do the data displays. Forget the “subfile” for this because you won’t have 5250 available.
here i modify my question how to use cbwx.dll for calling rpgle program from asp.net
Documentation for cwbx.dll (Program Calls) is in the Programmer’s Toolkit.
On your PC, navigate through Start-> Programs-> IBM iSeries Access for Windows-> Programmer’s Toolkit. Inside the Programmer’s Toolkit, review the Program Call documentation for the ActiveX objects.
For an example of someone using cwbx.dll, see Calling AS/400 (AS400) RPG Programs From ASP.NET and a followup article.
But be aware that you can’t call a program that has a display file. There is no display device for it to use.