kingkongrevenge has asked for the wisdom of the Perl Monks concerning the following question:

I need to automate interaction with an IBM z/OS "green screen" application. The obvious answers include trying Net::Telnet or scripting with s3270. But the catch is that I can't install anything in this environment. Nothing like Hummingbird or IBM Terminal Emulator are available. I have only what's in Perl 5.8.4 and what I can code up myself.

I've tried to read the relevant RFC and the source code to s3270, but I really can't even begin to figure how to code a client.

If I connect to the IBM server with telnet I do get some text. I see the initial login screen, but I can't interact with it. As soon as I hit enter things go all garbled.

So I tried to reverse engineer the protocol by coding a little proxy (no tcpdump or netcat available). I had a script open an IO::Socket::INET to the IBM server and another listen for a local connection. It then IO::Selects between the two and writes back and forth and dumps everything to the screen. When I telnet/tn3270 to the local proxy, there is no output to the screen at all and the client says it's waiting to connect. Nothing fails, both sockets just sit there doing nothing.

Any advice on how to proceed would be much appreciated, because I am stuck. I guess my next step is to study the source of Net::Telnet and try doing some of what that does.

Replies are listed 'Best First'.
Re: automate / screenscrape tn3270 session
by pemungkah (Priest) on Sep 14, 2007 at 06:59 UTC
Re: automate / screenscrape tn3270 session
by roboticus (Chancellor) on Sep 14, 2007 at 14:26 UTC
    kingkongrevenge:

    If you can't install anything on your local box, perhaps you can get someone to install some code on your mainframe? If so, and your mainframe is running the FTP server, you can submit jobs using FTP to tell the mainframe to do things for you.

    If you're well versed in JCL, you can even write your own jobs and submit 'em.

    ...roboticus