| Command | What it does |
|---|---|
type "text" | Types the text at the cursor. |
type {name} | Asks for a value when the macro runs, then types it. {password} is asked for hidden and never saved. |
press KEY | Presses a key. After Enter and the other keys that send the screen, it waits for the mainframe to answer. |
wait "text" [seconds] | Waits until the text appears on the screen, for up to the given number of seconds. |
move ROW COL | Moves the cursor to that row and column. |
pause SECONDS | Waits that many seconds. |
# comment | Ignored when the macro runs. |
Keys for press are Enter, Clear, PF1 to PF24, PA1 to PA3, Tab, BackTab, Home, NewLine, EraseEOF, EraseInput, Reset, Insert, Delete, Backspace and the arrow keys.
An example
This macro logs on to CICS. It asks for the user ID and password each time it runs.
wait "LOGON ==>"
type "CICSPROD"
press Enter
type {user} # asked for when it runs
press Tab
type {password} # asked for, hidden, never saved
press Enter
wait "READY" 10Record a macro
- Press Ctrl+K and choose Macros.
- Choose Record a macro.
- Do the task on the screen as you normally would.
- Press Ctrl+K and choose Stop recording.
Recording never keeps what’s typed into a hidden field. It records type {password} instead, so the macro asks for the password when it runs. The recorded macro is a plain script you can read and edit afterwards.
Write or edit a macro
You can write a macro from scratch in the Macros panel, or edit one you recorded or imported. If a line has a mistake, WND Terminal explains it with its line number.
Run a macro
- From the Macros panel.
- From the Ctrl+K palette, such as “Run macro: Logon”.
- From a key. In Ctrl+K > Keyboard maps, set a key to “Run the macro Logon”. See Keyboard maps.
A running macro can be stopped at any time. Other sessions keep working while it runs.
Import PCOMM macros
In Ctrl+K > Macros, import a PCOMM .mac file. Common lines become steps, and the rest are listed so you can see what didn’t convert. Simple macros convert fully, or with message boxes left out. Macros with program logic or screen reading need a person to rebuild them. See Import from PCOMM.
What isn’t supported
WND Terminal doesn’t run VBA, Reflection Basic, BlueZone scripts or EXTRA! Basic macros. The Migration readiness report counts these and lists each file for a person, so you know how many there are before you move.
Some jobs people used to script are built in. Fill from Excel types each row of a spreadsheet into an entry screen and writes the host’s answer back. Capture all pages collects a multi-page list into one Excel table.