ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

How can I auto repeat a sequence of green screen operations for each item in a list?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How can I auto repeat a sequence of green screen operations for each item in a list?

    I have a list of invoice numbers. There are hundreds of them. I can put it into a spreadsheet, text file, or iSeries DB2 table.

    For each invoice number I need to repeat a sequence of screens on the iSeries.

    Tab, Tab Tab, type invoice number, field exit, press enter, Tab, Tab Tab, type 31, press enter, type *YES, press enter, press F10, page down, Tab, type *YES, Press F12, Press F12

    I would think I could do this with HOD macros, but can't find any examples of anything like it that would illustrate how to go about it.

    Help me please or they will make me do this all by hand!!!

  • #2
    I did that quite a lot with the old Client Access 5250 emulator. Its macros were in Microsoft VBA, so it was fairly easy to modify them to loop and read/write files.

    The new iACS Emulator I think still supports playing VBA macros, but not creating them since iACS is cross platform but VBA is not. I have not tried writing a complex macro in the new language yet.

    The emulator supports recording a macro (the red circle icon in the emulator toolbar). I would recommend you try the following:
    • Start recording
    • Perform the required sequence twice, for different invoice numbers
    • Stop recording
    • Open the macro file and try and relate the macro commands to your keyboard inputs. Find the block of commands that relates to a single invoice number operation
    • Copy/paste the block however many times are needed, each for a different invoice number
    I have no idea if the new macro language supports loops or file reading, so your only option may be to have a separate block of macro instructions per file. maybe you could use an excel formula to build the required block of commands for each invoice number.

    Comment


    • #3
      Yes, I suppose the excel solution is possible. Not pretty, but at least possible. The spreadsheet and resulting text file would be huge for 3500 invoices.

      I was hoping for a link or example of using the HOD macros to do it. Or maybe Python. Or VBA. I don't have a recent copy of Visual Basic, so would need to use what comes with Excel, but could do it any of those ways if I had any example.

      Anything would be better than keying (copy/paste from excel) them all, which is what I had to do again for a list of invoices today.

      I feel I'm stuck in an IBM version of Groundhog Day and just can't find a way out...
      Last edited by bobc_00001; March 5, 2019, 02:41 AM.

      Comment


      • #4
        Another option is to see what the program that's controlling the screen does with the information that's been entered...and create another version that would take input from a file of invoice numbers instead.

        Cheers,

        Emmanuel

        Comment


        • #5
          Emmanuel, Thanks for the response...

          We are running an IBM Gentran command and don't have the source code, and it doesn't work correctly if fed via parameters, so the only ways I see to go about are to reselect all the original data and remap the invoices from scratch, or feed the screen.

          Comment


          • #6
            Got it - in that case, you may want to consider Automate - it's a commercial product. I haven't used it, but I think it will do what you need:

            Automate offers scalable, no-code automation software for both GUI and back-end processes. Get user-friendly RPA with Fortra's Automate (previously HelpSystems).


            I'm not affiliated with Help Systems.

            Cheers,

            Emmanuel

            Comment


            • #7
              If your company will not stretch to a commercial product then take a look at Albert York's TNAPI (second entry on this page http://www.albertyork.yolasite.com/samples.php) I haven't used it for a while but it allows for programmatic control of a 5250 screen.

              In fact now that I have refreshed my memory ... You may even be able to use the utility RUNTNSCR that comes with it - it allows for a script file to drive the application and looks fairly comprehensive.
              Last edited by JonBoy; March 5, 2019, 09:30 AM.

              Comment


              • #8
                Yes, there is zero budget for this unless it can run from my PC and cost less than $20, because I'd have to pay for it myself.

                I was looking at that, jonboy, but will see if I get a VBA option of some kind, or a way to do it with ACS HOD macro script. I have the feeling the VBA is no longer an option though, because I'm running the java ACS client.

                At this point it looks likely that I'll be sitting here for hours copying and pasting invoice numbers and clicking run macro. That's what I've had to do in the past and its very depressing to see it coming again...

                Comment


                • #9
                  Here's an old Client Access script that I was working on in the past to read a comma delimited file, populate a screen and simulate an ENTER key.

                  Can't vouch for its usability because I wrote it about 9 years ago...but it might be a good base to start from...

                  Attached Files

                  Comment


                  • #10
                    If you have an Excel spreadsheet you should be able to use VBA to convert it to RUNTNSCR. Hell of a lot easier than typing.

                    Comment


                    • #11
                      Thanks, hopefully one of these will work with ACS HOD. I spoke to the local support guy and he said the Client Access goes off support in April, so doesn't want to reinstall it. I don't think the ACS supports VBA solutions.

                      Comment


                      • #12
                        We've tried the new Java emulator at Version 1.1.7.3 -- not sure its ready for prime time.

                        Slow, doesn't seem to handle true 5250 keyboards very well (BOS), Navigator doesn't seem to be stable, etc. But hey...it looks pretty!

                        It will probably mature in a couple years but we'll never be able to switch here because of the macro incompatibility...we'll switch platforms before that ever gets fixed...lol

                        Comment


                        • #13
                          Yes, that's the version I'm running. I'm looking now at taking the code it creates and changing it. I have been trying to use variables but there are no examples whatsoever, so I don't know how to name them on the command line or in the program. I was thinking maybe I could run it as a program from the command line with the parameters, and generate the commands with excel. If not I actually need to generate the all the macro text itself with a program of some kind based on the skeleton and substituting the invoice number values.

                          Comment


                          • #14
                            At this point the choices left are to copy/paste each invoice number in and run a macro up to 3500 times or write a program to write a huge macro that includes all the invoice numbers. RPG would not be optimal for that. I am thinking maybe I could do it in QSH, but not sure. Python would be another possibility. Another possibility would be to take the macro and the invoice list over to my home PC (under Linux) and use my old 1980's DOS Brief editor and its macros in a DOS box to write the ACS HOD macro. I think it could probably do it without writing any code.

                            I'm afraid I didn't find any other solutions. That's quite a statement there.

                            Comment


                            • #15
                              Why not write a program that generates a huge macro that could be run afterwards?
                              Vectorspace gave the initial idea of recording the macro - ie generating a template.
                              Then you can extract what is necessary for entering one invoice and repeat it for every invoice number available.

                              May be ugly but it works ( I hope at least :-) )

                              regards
                              Peder

                              Comment

                              Working...
                              X