PASSPORT Knowledge Base
Macros

Date Published: February 22, 2005
Date Updated: October 28, 2008

Title

Scheduling a Macro to Run at a Specific Time

Product

PASSPORT PC to Host, PASSPORT Web to Host

Emulation Types

TN3270, TN5250, VT, SCO ANSI, Wyse 60

Issue

I would like to configure PASSPORT to receive a file at a specified time each day from my TN3270 host using IND$FILE. Is this possible?

Solution

A PASSPORT session can be configured to use a startup macro, which can perform the ReceiveFile function (see sample below). Then the Windows Task Scheduler may be used to start the PASSPORT session at the specified time.

Sample

Sub ZMain()

Dim Text, ret

SendHostKeys ("MyLogon<ENTER>")

ret = WaitForHostUpdate(10)

ret = WaitForHostUpdate(10)

SendHostKeys ("MyPassword<ENTER>")

ret = WaitForHostUpdate(10)

ret = WaitForHostUpdate(10)

ret = ReceiveFile ("C:\MyPCFile.txt MyHostFile.txt ASCII CRLF")

ret = WaitForHostUpdate(10)

ret = WaitForHostUpdate(10)

End Sub

Follow the steps below to configure PASSPORT to use a startup macro:

For PASSPORT PC to Host:

  1. Start a PASSPORT session.
  2. Choose the Communications®Disconnect menu command.
  3. Choose the Communications®Setup menu command.
  4. Select the Miscellaneous tab.
  5. Enable the Startup Macro check box.
  6. Click the Browse button and select the appropriate macro.
  7. Click Connect to save and test.

For PASSPORT Web to Host:

  1. Start the PASSPORT Web to Host Administrator program.
  2. Open the session to configure.
  3. Select the Miscellaneous tab.
  4. Enable the Startup Macro check box.
  5. Choose the appropriate macro from the drop-down list.
  6. Click OK to save or Connect to test.

More Information

    1. Go to Control Panel and open Schedule Tasks.
    2. Double click to open Add Schedule Task.
    3. Follow through the wizard to add a new scheduled task.

Keywords

macro, time, schedule, transfer, run, automatically, start , up