Telnet CL program on AS400

20 pts.
Tags:
AS/400
CL programs
Telnet
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: October 14, 2009  10:28 PM
UPDATED: October 15, 2009  8:22 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

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 <a href=”http://think400.dk/downloads.htm”>TNAPI utility.</a> 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

Discuss This Question: 2  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • wkozerski
    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?
    20 pointsBadges:
    report
  • CharlieBrowne
    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 http://publib.boulder.ibm.com/iseries/v5r1/ic2924/index.htm?info/cl/sbmrmtcm.htm
    39,815 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following