Telnet CL program on AS400
20 pts.
0
Q:
Telnet CL program on AS400
Does anyone know if it is possible to write a CL or RPG program that will automate a telnet session to a second device to change data?   I have a multiple fuel controllers that I need to telnet into daily and change the current fuel price. I would like to automate this. Does any onw know how to do it from the an AS/400?   Thanks.



Software/Hardware used:
Iseries V5.4
ASKED: Oct 14 2009  10:28 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
7785 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
Are you sure TELNET is the best solution?

Is it possible to to pass the data with FTP.
Or a SBMRMTCMD,
Or SQL using the CONNECT option.

These three could be automated easily and have table values set up for easy maintenance.

==================================================================

Some alternative to telnet would definitely be preferable. With that said --

Yes, both CL and RPG can do it, with some general restrictions.

1. It requires profiency with whichever language is used. By asking the question, it seems difficult to believe that this condition is met.

2. For CL, it would need to be on a V5R4 system or higher, and it would need to be ILE CL.

3. General proficiency in sockets programming is needed.

Telnet is a well defined internet protocol. RFCs describe how it works. A telnet client is mostly just a sockets program that connects to a telnet server, negotiates the session parameters, and then proxies what goes into the keyboard and out to the display with the telnet server. (Simplified, but that's the basics.)

Bear in mind that System i telnet is structured as TN5250 -- intended for devices that support the 5250 data stream. If you can cleanly use green-screen telnet (STRTCPTELN or TELNET commands) to perform these tasks, then maybe alternatives are possible -- maybe.

Easiest to start would perhaps be to obtain/install/study Albert York's TNAPI utility. IIRC, it explicitly connects to the System i telnet server itself; but once that's done, you can pass in the TELNET command as if you were running green-screen and go from there. It's not intended for outbound connections, but I don't think there's any way it knows that outbound is being established inside of it.

And if the remote can be accessed via dial-up Point-to-Point, then you can go with Interactive Terminal Facility (via STRITF and asysnc) and related functions.

Tom

Tom
Last Answered: Oct 15 2009  8:22 PM GMT by TomLiotta   7785 pts.
Latest Contributors: CharlieBrowne   6540 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Wkozerski   20 pts.  |   Oct 15 2009  12:39PM GMT

No I’m not. I have been doing it manually using telnet that uis why I was trying to use that method. How would I do it using remote command?

 

CharlieBrowne   6540 pts.  |   Oct 15 2009  12:49PM GMT

If your replaceing hte contents of a small file, FTP may be the best.
You can search this list and find examples on how to do that.
*
Another possiblity is the setup DDM files on the target system. Think of this as a LF on your system over data on the source system. Then you can write and run code over those files.
*
Here is a link for the SBMRMTCMD
 <a href="http://publib.boulder.ibm.com/iseries/v5r1/ic2924/index.htm?info/cl/sbmrmtcm.htm" title="http://publib.boulder.ibm.com/iseries/v5r1/ic2924/index.htm?info/cl/sbmrmtcm.htm" target="_blank">http://publib.boulder.ibm.com/iseries/v5…</a>

 
0