Forum Discussion

Geethanjali's avatar
Occasional Contributor
4 years ago

Extracting Text from iseries (mainframe-green screen) applications



Has anyone have experience in extracting specific text from Mainframe applications. I have already enabled Text Recognition through which am able to automate entering values. But am struggling to extract the values for specific fields displayed in the screen. The whole screen is taken up as an object.


Any thoughts on this will really help. 






  • hi  


    I have resolved this issue. 


    I tried OCR, but that didnot help me much because it provided me a chunk of data from the screen and I felt it really difficult to extract the specific data. Not sure if it had more effective ways 


    The solution which worked out for me was 

    Used text recognition in order to recognise the AS400 window. 

    Used key strokes for keying in the data

    used the feature ( Edit - Send to scratch pad) option in AS400 after which I recogonised that scratch pad window to get the details displayed. Since the positions and length are fixed I used relative positioning and length to extract the data. 

    Tried for couple of screens, it has worked.Have to see how it progresses. 


7 Replies

  • BenoitB's avatar
    Community Hero

    You must do OCR on specific region and specify to the ocr routine the font used.

    Size of as400 screen is fixed and fields position too.

    Use it to make template of each screen to manipulate.

    • Geethanjali's avatar
      Occasional Contributor

      Hello, Thanks very much for your reply.. are there methods to extract text with the give rowid and columnid from the mainframe screen ?


      I don't have Intelligent Quality add in installed. 

      Is there any other way to do it or do we only require OCR to be enabled ?

      Thanks very much




      • BenoitB's avatar
        Community Hero

        Without Intelligent Quality you can still have OCR

        Read more on this article (the deprecated one)

        But since the new ocr appeared it seems that the old OCR was lowered in quailty (this is my personal feeling) so it doesn't works as well as in the past.


        But you can also use regions checkpoint (so using image fragment).

        Here as the interface is very stable and pixels colors are well defined it could be a good alternative.

        So build a library of Regions corresponding to your main fields ...

        Or even more touchy but sexier, built on the fly the image fragment from the desired text.. -> Create a bitmap object with background color the same as your terminal background color, use Win32Api to write on this bitmap with the same font/color as the terminal .. and you'll have way to avoid building a large library of Regions ...


        sonya_m  This could be a very intersting technical challenge

        function CreateRegionFromString(MyString, FontObject, Background (color or other bitmap)) {

          return a bitmap that can be directly used with Region.Check