When accessing any mainframe, application using an emulator, many of the day to day activities would be a certain set of actions performed as a routine. These can be automated using IBM Personal Communications macros. A series of actions can be recorded as a macro and it can be played/executed to perform those set of actions without much manual intervention A simple VBS Macro which is recorded from PCOMM will look like below, and will need no user intervention. In this example, user is navigating from first screen of host (after login) and going to ready prompt screen. For this operation user has to press ‘F3’, ‘F3’ and then type option 3 for “Process Option” field and “Enter”. Hence these keystrokes can be seen in the sample code generated by PCOMM. /*********************************************** [PCOMM SCRIPT HEADER] LANGUAGE=VBSCRIPT DESCRIPTION= [PCOMM SCRIPT SOURCE] OPTION EXPLICIT autECLSession.SetConnectionByName(ThisSessionName) REM This line calls the macro subroutine subSub1_ sub subSub1_() autECLSession.autECLOIA.WaitForAppAvailable autECLSession.autECLOIA.WaitForInputReady autECLSession.autECLPS.SendKeys "[pf3]" autECLSession.autECLPS.WaitForAttrib 22,13,"00","3c",3,10000 autECLSession.autECLPS.Wait 3088 autECLSession.autECLOIA.WaitForAppAvailable autECLSession.autECLOIA.WaitForInputReady autECLSession.autECLPS.SendKeys "[pf3]" autECLSession.autECLPS.WaitForAttrib 4,24,"00","3c",3,10000 autECLSession.autECLPS.WaitForCursor 4,25,10000 autECLSession.autECLOIA.WaitForAppAvailable autECLSession.autECLOIA.WaitForInputReady autECLSession.autECLPS.SendKeys "3" autECLSession.autECLOIA.WaitForInputReady autECLSession.autECLPS.SendKeys "[enter]" end sub **************************************************************/ Also we can edit above macro and make it interactive by seeking user input for any input field. Let us modify above code to seek user input for Entry option “3” i.e. for Process Option field /********************************************************************* [PCOMM SCRIPT HEADER] LANGUAGE=VBSCRIPT DESCRIPTION= [PCOMM SCRIPT SOURCE] OPTION EXPLICIT autECLSession.SetConnectionByName(ThisSessionName) REM This line calls the macro subroutine subSub1_ sub subSub1_() Dim strAnswer autECLSession.autECLOIA.WaitForAppAvailable autECLSession.autECLOIA.WaitForInputReady autECLSession.autECLPS.SendKeys "[pf3]" autECLSession.autECLPS.WaitForAttrib 22,13,"00","3c",3,10000 autECLSession.autECLPS.Wait 3088 autECLSession.autECLOIA.WaitForAppAvailable autECLSession.autECLOIA.WaitForInputReady autECLSession.autECLPS.SendKeys "[pf3]" autECLSession.autECLPS.WaitForAttrib 4,24,"00","3c",3,10000 autECLSession.autECLPS.WaitForCursor 4,25,10000 autECLSession.autECLOIA.WaitForAppAvailable autECLSession.autECLOIA.WaitForInputReady strAnswer = InputBox("Please enter a Process Option:") autECLSession.autECLPS.SendKeys strAnswer autECLSession.autECLOIA.WaitForInputReady autECLSession.autECLPS.SendKeys "[enter]" end sub ******************************************************************/ A macro can be a PCOMM inbuilt runnable macro or it can be invoked through various applications like VBA, MS Excel, Java script, C# or C++. A programmatic access to a host emulator session can be achieved using HACL API’s. The Host Access Class Library (HACL) is a set of objects that allows application programmers to access host applications easily and quickly. IBM Personal Communications provides support for a wide variety of programming languages and environments by supporting several different HACL layers and more about this is explained in support link 1.https://www.ibm.com/support/knowledgecenter/en/SSEQ5Y_12.0.0/com.ibm.pcomm.doc/books/html/host_access06.htm 2.https://www.tetcommunity.com/blogs/interaction-with-mainframes-made-easy-with-ibm-personal-communications-api The following list of use cases gives us an idea of what all can be achieved using macros in IBM Personal Communications. Use case 1: Navigating from screen 1 to screen X In a scenario, a user might be interested in going directly to screen X, whereas to reach screen X, user has to go through screen 1,2,3..X and execute certain set of commands and this can be automated by recording a macro. User has to play this macro at screen 1 and macro would perform all the necessary steps and would stop at screen X. User case 2: Performing a simple print job User can record a macro to navigate to print jobs and perform print operation. Playing this macro user can print pre-defined jobs whenever they are in need of and by this manual steps can be avoided and print job can be automated. Use case 3: Logon operation User can record a macro to perform login operation for a host machine and play this macro at the login screen for automated login. Use case 4: File transfer operations User can record a macro to perform File transfer operation to/from a host machine and play this macro to automatically receive/send files. Use case 5: To generate reports User can record a macro to generate periodic reports and play this macro to automatically generate reports using a set of operations. Also users can extend this as per their business needs. Read more on Macro Play/record from IBM support websites. 1.https://www.ibm.com/support/knowledgecenter/en/SSEQ5Y_12.0.0/com.ibm.pcomm.doc/books/html/quick_beginnings08.htm#mcr P.S: Macro play and record can be limited to Admin users only and read more on this “Advanced configurations” under “User Preferences” Vinay Nanjundappa L3 Support, PCOMM
1 Comment
9/16/2019 05:03:59 am
Dear Blogger,
Reply
Leave a Reply. |