3/19/08 Using macros in emulator programs

Within most 5250 emulator programs there is a little used featured called a macro. This can save you time and reduce errors. Macros can be used for all kinds of things. For instance, common commands (i.e. a basic spool file look up - WRKSPLF) or a pre-defined query (example: RUNQRY *N ‘name of query’)

Here is an example of using a macro for a basic AS/400 sign on.
(**NOTE: This can pose a security risk as this creates a file that displays this user ID and password in plain text. Anyone with access to the PC and that file could retrieve this information.**)

The following is an example using Client Access. To record the sign-on macro, click on "record" button in your emulator tool bar. A window will pop up asking you to name your macro (example: Signon) and select OK. The macro file will be created in the Client Access private folder with a .mac extension. This is also useful if your password changes so you can modify the macro without creating a new one. Now, type in the user ID and password, hit the Enter key. Once this is done, select the "Stop" button in your emulator tool bar.

To run the macro once the session is started, click on the "Start a macro/script" button or select it in the Actions drop down top bar. At the Play Macro/Script window, select the name of the macro to be used (example: Signon), and then click "OK." This will allow the macro to run automatically when the session is started and automatically log you into the system and run the command you just entered.

*Note: Other emulator programs such as MochaSoft offer similar options.

Disclaimer: Vision Solutions makes every effort to provide accurate system management information and programming code; however the company cannot be held liable for the accuracy of information nor its compatibility in your own environment. Please review and test thoroughly before implementing. © Copyright 2008, Vision Solutions, Inc. All rights reserved. IBM, System i, iSeries, and AS/400 are trademarks of International Business Machines Corporation.


Vision Solutions said...

This entry was recently updated to include a warning about the potential security dangers of using an emulation macro to automate a system sign-on.

Sting_Chameleon said...

I'm not really too sure about this, seemingly enough this seems fairly old, but a question is a question after all.

When dealing with macros, can the macro string used be endless if the emulator can handle how much of a string is inserted?

And can the single macro being instructed, tackle multiple tasks at once without the computer(or whatever device is using the macro) crashing?

I really don't know the limitations to this, and I want to be on the safe side when using macros, although I'm not sure if there is a limit to begin with.