IBM Support

IBM i Access Client Solutions 5250 Macro Scripting

Troubleshooting


Problem

This document discusses the difference in 5250 macro scripting support in IBM i Access Client Solutions.

Symptom

N/A

Cause

N/A

Environment

N/A

Diagnosing The Problem

N/A

Resolving The Problem

Many users have created Macros in the Access for Windows PC5250 environment. The macros were created in a .mac or .vbs format. The macros created by capturing the mouse and keyboard input will import using the macro conversion utility in IBM i Access Client Solutions. However, many administrators have created custom scripts written to accomplish various tasks. If customized scripts have been created, the macro conversion utility will not work. You must start over using the new Host On-Demand Macro Programming language. The reason for this change is simple. It is now multi-platform; Linux and Mac have no idea what VBScript is.

The following is not intended as a walkthrough. It is an example to provide an example syntax for the Host On-Demand Macro Program language.

Full documentation for this language is available at the following URL:
https://www.ibm.com/docs/en/host-on-demand/12.0?topic=macro-programming-guide
Please note that the version of the HOD emulator that IBM i ACS uses is based off of an older version of HOD and that guide is no longer available.
The guide above is for version 12 of HOD.  This means if enhancements are in the newer version of HOD macros it would not apply to IBM i ACS.

Many of the functions available from the old macro format and Java script format in PC5250 had built-in functionality where this new script has limited functions built in. However, it does allow you to import Java functions and methods into it.
The SQL Query function is not supported in ACS 5250 macros.
In addition, the following HOD macro functions are not supported:
<sqlquery>
<filexfer>
<fileupload>
<trace>
<print start>
<print extract>
<print end>
The following are examples only. Use at your own risk. There is no support.

Example #1

This script gets the current date and time, formats it, and outputs it to current cursor location. This script imports java.util.date and java.text.SimpleDateFormat.
Note: Some of the lines have wrapped.

 <HAScript name="Test" description="" timeout="60000" pausetime="300" promptall="true" blockinput="false" author="Name" creationdate="Aug 20, 2015 3:28:37 PM" supressclearevents="false" usevars="true" ignorepauseforenhancedtn="true" delayifnotenhancedtn="0" ignorepausetimeforenhancedtn="true" continueontimeout="true">

    <import>
        <type class="java.util.Date" name="date"/>
        <type class="java.text.SimpleDateFormat" name="SimpleDateFormat"/>
    </import>

    <vars>
      <create name="$curdate$" type="date" value="$new date()$" />
      <create name="$sdf$" type="SimpleDateFormat" value="$new SimpleDateFormat('MM-dd-yyyy hh:mm:ss')$" />
      <create name="$dts$" type="string" value="$sdf.format($curdate$)$" />
    </vars>


    <screen name="Screen1" entryscreen="true" exitscreen="true" transient="false">
        <description >
            <oia status="NOTINHIBITED" optional="false" invertmatch="false" />
        </description>
        <actions>
            <input value="&apos;This is a test: &apos;+$dts$" row="0" col="0" movecursor="true" xlatehostkeys="true" encrypted="false" />
        </actions>
        <nextscreens timeout="0" >
        </nextscreens>
    </screen>

</HAScript>



Example #2

This is a more advanced script that launches the IBM i Access Client Solutions Printer Output utility to the currently connected to IBM i OS system..
Note: Some of the lines have wrapped.

<HAScript name="SpoolFile" description="Display spool files for currently logged on to LPAR" timeout="60000" pausetime="300" promptall="true" blockinput="false" author="Name" creationdate="02-March-2016" supressclearevents="false" usevars="true" ignorepauseforenhancedtn="false" delayifnotenhancedtn="0" ignorepausetimeforenhancedtn="true" continueontimeout="false">

 

    <screen name="Screen1" entryscreen="true" exitscreen="true" transient="false">

        <description >

            <oia status="NOTINHIBITED" optional="false" invertmatch="false" />

        </description>

        <actions>

            <runprogram exe="&apos;java.exe -jar c:\\IBM\\iAccess\\acsbundle.jar /plugin=splf /system=&apos;+$HMLSessionUtil.getHost()$" param="" wait="false" assignexitvalue="" />

        </actions>

        <nextscreens timeout="0" >

        </nextscreens>

    </screen>

</HAScript>




Example #3
This example shows a demonstration of how to prompt for input with a message box and places the data entered in the message box on to the command line.
Note: Some of the lines have wrapped.

<HAScript name="test" description="input dialog" timeout="60000" pausetime="300" promptall="true" blockinput="false" author="Jerry mcKee" creationdate="09/27/2017" supressclearevents="false" usevars="true" ignorepauseforenhancedtn="true" delayifnotenhancedtn="0" ignorepausetimeforenhancedtn="true" continueontimeout="false">

    <vars>
      <create name="$strData$" type="string" value="true" />
    </vars>


    <screen name="Screen1" entryscreen="false" exitscreen="true" transient="false">
        <description >
            <oia status="NOTINHIBITED" optional="false" invertmatch="false" />
        </description>
        <actions>
            <prompt name="&apos;Type true or false&apos;" description="" row="0" col="0" len="80" default="" clearfield="false" encrypted="false" movecursor="true" xlatehostkeys="true" assigntovar="$strData$" varupdateonly="true" required="false" title="" />
            <input value="$strData$" row="0" col="0" movecursor="true" xlatehostkeys="true" encrypted="false" />
        </actions>
        <nextscreens timeout="0" >
        </nextscreens>
        <recolimit value="10000" />
    </screen>

</HAScript>

Related Information

[{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Access Client Solutions","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"Version Independent","Edition":"Advanced","Line of Business":{"code":"LOB57","label":"Power"}},{"Product":{"code":"SWG60","label":"IBM i"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":" ","Platform":[{"code":"","label":""}],"Version":"","Edition":"","Line of Business":{"code":"LOB57","label":"Power"}}]

Document Information

Modified date:
05 April 2021

UID

nas8N1020968