docmain.css" /> B. Record and edit a macro in a Reflection Desktop session. - Automated Sign-On for Mainframe Administrator Guide

B. Record and edit a macro in a Reflection Desktop session.

The logon macro is initiated when an authenticated user launches the session to connect or reconnect to the host.

NOTE:These instructions are guidelines to enable Automated Sign-On for Mainframe. Although error- checking is omitted for brevity and clarity, the macro author should check for errors as required by the application.

  1. In the 3270 session you just created, start the macro recorder (Tools > Macros > Record Macro).

  2. Connect to the host and log on to the appropriate host application using a valid user name and password.

    You will edit the macro to remove specific user information and replace it with values that support logon by any authenticated user.

  3. Stop the macro recorder (Tools > Macros > Stop Recording).

  4. In the Recording Complete dialog, name the macro (for example TSO_logon). Click OK.

  5. Save the macro with the current document (session) or in the common project.

    By saving the macro with the current document, it will be transferred to the MSS Administrative Server when the session is saved in the Administrative Console, and then distributed to users who run this session from the list of session links.

  6. Open the Visual Basic Editor (Macros > Visual Basic). Locate your macro: open Project > Modules, and double-click Recorded (or right-click > View Code).

  7. After retrieving the ibmCurrentTerminal object, add the following line:

    ibmCurrentTerminal.GetDASOPassTicket("APPID")

    where "APPID" is replaced with the appropriate host application ID.

  8. Edit the statement that sends your user name. Remove your user name and replace it with the mainframe username that was retrieved by the GetDASOPassTicket function call.

    The edited line should look like this:

    ibmCurrentScreen.SendKeys(ibmCurrentTerminal.DASOUserID)
  9. a. Comment out or delete the line that uses the PasswordBox function to prompt the user for the password.

    hiddenTextEntry = ibmCurrentTerminal.Macro.PasswordBox("", "")
    If (hiddenTextEntry = "") Then
        Err.Raise 5002, "Hidden TextEntry", "No Value Provided.", "VBAHelp.chm", "5002"
    End If

    b. Replace it with a line that looks like this:

    ibmCurrentScreen.SendKeys(ibmCurrentTerminal.DASOPassTicket)
  10. Save the macro. Click Yes to send settings to the MSS Administrative Server.

    Close the Visual Basic editor, and keep the session open.

  11. Click the Document Settings button in the toolbar. On the Settings dialog, under Host Connections, select Configure Advanced Connection Settings.

  12. In Configure Advanced Connection Settings, under Connection Action, check the boxes to

    • Run a macro or other action after the initial connection.

      Select the logon macro and click Ok.

    • Run when reconnecting.

      Select the logon macro and click Ok. The macro will be initiated when a user connects to a mainframe session.

  13. Save the session. (Click Save or Exit.) Click Yes to send the settings to the MSS Administrative Server.