Screen capture from the mainframe

If I wanted any proof that I was a resillient and obssessive automator, this incident was more than sufficient. Our team was faced with a predicament – the business wanted to get some reports downloaded from the testing region. Usually this was an easy process, we could download the report From CA-View and email or FTP it.

After a migration to a new firewall, FTP & email stopped working and we had to download reports that were more than 1000 pages. The last option (not the best, but had to be done) was a screen capture process. I had three options

  • VB.Net to use the Quick3270 Object and extract the data
  • Excel and VBA to capture screenshots (again with the Quick3270 Object)
  • Quick3270 Macro Language

I tried each and every option from the list above (in the same order). VB.Net seemed to be an overkill. I had to create forms (to collect screen details, logon information etc.)

Quick3270 Screen Capture Macro

VBA & Excel was looking like a good option; I had worked with this combination in the past when we had to download the entire list of FCTs from the CICS region (CEMT & Screen capture did a pretty good job). The screen capture Excel Macro worked well, except for a couple of points which didn’t make this the option of choice. Firstly, the macro could capture data one line at a time (since the code needed to identify the last line of the data on the screen). Secondly, due to login process, screen navigation, etc., one couldn’t guarantee that the user was on the right page. Finally, it was nearly impossible to pause/stop the macro without force closing the program.

Quick3270 Macro it was. While it is based on Visual Basic commands and structure (it even has constants such as vbOkOnly), it does not have the entire instruction set. Picking up parts from the VBA code and modifying it for the Macro language, the final product was ready.

The Macro language had decent support for File I/O and could create Excel.Application Objects. With this, I gave flexibility to the user to route the output into a new excel sheet or into a text file. The language did not support arrays, which meant that concatenating data across screens (scrolling horizontally) required some long winding logic. Creating 24 different variables (one for each line), assigning them data, scrolling and appending data, this took up about 1/3rd of the macro coding. Similar pages of code had to be written for outputting data (variable by variable).

The reference Guide for the Quick3270 Macro language can be found on the dn-computing downloads page. I must warn you that the Macro language is specific to the version you are using. The manual is for v4.12, do take this in consideration while starting to code.

With my battle scars to show for and a running macro, I think I will keep this language in mind during future ventures into Mainframe Automation.

(203) Total number of views

6 thoughts on “Screen capture from the mainframe

  1. Hi,

    We are trying to automate Quick3270 using VB.NET but cant seem to get it to work.

    Could you provide me some sample code of how you managed to do this?



    • Hi Oliver,

      Sorry about the delay. I was trying to pull some the code which I had earlier. Unfortunately, I haven’t been able to get that. Have you looked at the samples in the Quick3270 help file. I thought it was a good starting point. If you have any specific questions, pls. post your code and I will do my best to help out.

      Ramesh (thecodeisclear)

  2. You are doing a fabulous job.Can I join you in your great initiative.

    • Thanks bro for the comments. Sure, you can join me. My email address is thecodeisclear[at]

      • Hi,
        I am also wokring on the similar task. but I am using vba with MS Access. I am using Rumba screen TN 3270 PLUS. But I could not see menu bar to record Mainframe macros. I struk here. Please help me if you can.

        • The application that I have used had a separate menu option for Macros. Are you using the product from Microfocus? If so, you may have to search through the menus (maybe under Tools).

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="" cssfile="">