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

I am seeking for a way to start a Mainframe (MF) application from a (Windows-) PC. The Task is:

- preparing the results of a MF SQL into PC-Documents
- having a single PC-Application for, hmmm let's just say endusers
- not to touch the host manually via 3720-console

I am not allowed to have direct access from the PC to the Database, so I cannot use DBI::DB2.
The transfer of files is easily done by Net::FTP.

The Solution will be something
- send inputfile (e.g. Query) to the mainframe (FTP-Task)
- start a MF-Job (to execute the query) <<<==== lack of wisdom is here
- FTP resultfile to PC
- doing lots of lovely things with Perl

We have IBM Personal Communications on the PC, does anybody know about a Perl-Wrapper?
Does anybody has used Telnet for similar tasks?
Any other suggestions?

Thanks for your help

Replies are listed 'Best First'.
Re: Access Mainframe from PC via Perl
by derby (Abbot) on Jul 19, 2002 at 11:07 UTC
    Brutha,

    note: take this with a grain of salt. My mainframe experiences were over ten years ago on an IBM 360 runing MVS, TSO and M204.

    I've done stuff like this in the past follwing the outline you've given. The local script would create a JCL stream that would be submitted, via FTP, to the mainframe. The JCL would contain the appropriate calls to FTP the data back to the local PC. Unfortunately, its the mainframe side of things that is most difficult. In my case, I knew some old mainframe programmers that were more than happy to write the PL1 code I could use in the JCL stream. You need to talk to the mainframe admins about how to set up and use a remote job execution.

    -derby

      So you are more experienced than I am ;-)

      My problem is exactly that "remote job execution". But the mainframe admins are at a different location and say no before you ask.

      I have seen an application feeding a 3270 Emulation with keystrokes, but I could not find out how to do it. (Or the wrong keywords for google).

      The other way round was simple, write a TCP Server for the PC and a Mainframe-Rexx opening a socket. If anybody is interested, then ask me. But it is pretty standard.

      Anyway, thank You for Your help.

        I was just about to say "well, the x3270 suite of tools looks promising" but you are on Windows.

        In theory you could work something up with expect and a terminal emulator. Go to www.freshmeat.net and search for '3270' and '5250'.

        See also the expect modules.