SuspendScript |
Top Previous Next |
×V3.1Ø
Syntax - SuspendScript <SuspendWindowStart> <SuspendWindowEnd> <ResumeTime> [<SuspendCallLabel> [<OnResumeGotoLabel>]]
<SuspendWindowStart> is a literal string or a variable that contains a literal string. <SuspendWindowEnd> is a literal string or a variable that contains a literal string. <ResumeTime> is a literal string or a variable that contains a literal string. <SuspendCallLabel> is a literal string or a variable that contains a literal string. <OnResumeGotoLabel> is a literal string or a variable that contains a literal string.
Description: This command is used to configure a scheduled pause during EMUE script execution. This can help prevent script failure during nightly mainframe maintenance or day end. When the suspension starts, EMUE disconnects from the mainframe. When the suspension is over, EMUE will sign back in.
The first two parameters <SuspendWindowStart> and <SuspendWindowEnd> configure a range of time during which EMUE should begin its pause. If the SuspendScript line is run within this window of time, EMUE will sign off of the mainframe and wait until the resume time specified by <ResumeTime> is reached. When the resume time is reached, EMUE will sign back into the mainframe and continue processing.
<SuspendWindowStart>, <SuspendWindowEnd>, and <ResumeTime> should all be in the "HH:mm" format.
The last two parameters optionally allow further configuration. The <SuspendCallLabel> instructs EMUE to perform a Call command before suspending script execution. If <SuspendCallLabel> is valued, EMUE will execute the commands following the label specified until a Return statement is reached. When EMUE reaches the Return statement, the suspension will begin. Providing a Call label allows for final processing before suspending. Processing may include logging a message or closing a batch. If there is no suspend call label provided, EMUE will suspend immediately without running any further code. If SuspendImmediately is used for the SuspendCallLabel, EMUE will not go to a Call label before suspending. Note that SuspendImmediately means that EMUE will suspend without running more code if the current time falls within the range provided by <SuspendWindowStart> and <SuspendWindowEnd>. If EMUE reaches the suspend script line when the current time does not fall within that range, processing will continue normally.
The <OnResumeGotoLabel> configures where EMUE should begin processing when it does resume. If this parameter is not provided, EMUE will continue processing on the line after the SuspendScript command. Additionally, ResumeAtNextLine is used for the <OnResumeGotoLabel>, EMUE will continue processing on the line after the SuspendScript command.
Careful consideration should be taken in determining where the SuspendScript command should be placed. If the script is doing batch processing, it might be best to have EMUE check to see if it is time to suspend in between batches. Note that the script is not paused as soon as the SuspendWindowStart is reached. EMUE only compares the current time to the suspension window each time the SuspendScript command is run. Therefore, it is important that the SuspendScript command is placed in a loop or in a part of code that runs over and over again. Otherwise, the script may never get paused because the SuspendScript line has not been run.
This command can be used without a mainframe connection.
Note: This feature is not supported in EMUE Standard.
Sample: The following code will suspend the script during the window of time starting at 8PM and ending at 10PM right after calling the label BeforeSuspendCall. The script will start processing the script at 1AM where it will resume at the next line. SuspendScript "8:00 PM" "10:00 PM" "1:00 AM" BeforeSuspendCall ResumeAtNextLine Send s "[Clear]" GoTo ReadFile
:BeforeSuspendCall LogLine "Suspending script for day end at " &now Return
|