18.08.2013 Views

LINC Programming Reference Manual - Public Support Login - Unisys

LINC Programming Reference Manual - Public Support Login - Unisys

LINC Programming Reference Manual - Public Support Login - Unisys

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

SLEEP (SLP)<br />

SLEEP (SLP)<br />

The SLEEP; command suspends execution of a Report. When reactivated, execution<br />

resumes from the next command in the Report logic.<br />

The SLEEP; command has the following variants:<br />

$ SLEEP n<br />

Any current database transaction is committed, and the Report is suspended for a<br />

number of seconds (in the range 0 through 9999). The Report is reactivated after this<br />

time, or if a WAKE.UP; command is received.<br />

For OS 2200 base <strong>LINC</strong> Systems, a SLEEP; 0 forces a database commit. A SLEEP; n<br />

(where n is greater than zero) initiates an end thread, followed by a wait of n seconds,<br />

followed by a begin thread.<br />

$ SLEEP; UNTIL WAKE.UP<br />

Any current database transaction is committed, and the Report is suspended until it is<br />

explicitly reactivated by a WAKE.UP; command, or termination of the Report.<br />

$ SLEEP; UNTIL WAKE.UP END.AFTER; n<br />

Any current database transaction is committed, and the Report is suspended until it is<br />

explicitly reactivated by a WAKE.UP; command, Report termination, or until after the<br />

specified number of seconds. In the latter case, GLB.CLOSE is set to CLOSE.<br />

Note: In a <strong>LINC</strong> Report generated as a Coroutine, the SLEEP; UNTIL WOKEN<br />

command performs an end transaction only. See the CALL; command for<br />

details of Coroutines.<br />

About the SLEEP; Command<br />

If GLB.CLOSE equals CLOSE when a SLEEP; command is executed, the Report goes to<br />

end-of-job.<br />

Following the SLEEP; command, a new database transaction (thread) will be started. On<br />

MCP based <strong>LINC</strong> Systems, this will occur on the first database update following the<br />

SLEEP; command.<br />

On OS 2200 based <strong>LINC</strong> Systems, if your Report is executed with the no restart option on<br />

the @XQT (@XQT,X), then the SLEEP; will not be actioned.<br />

On UNIX ORACLE Systems, updates are not available to other processes until a database<br />

commit occurs, normally at the end of Pre-Screen logic. If a WAKE.UP; command occurs in<br />

Main logic, and the update has not been committed in the Ispec, it is possible that the<br />

sleeping Report might not find any outstanding request in the parameter file when it is<br />

reactivated. This could result in some outstanding requests remaining in the parameter file.<br />

In LDA Run Time, if a SLEEP; command is executed within a block of logic introduced by a<br />

loop or a condition, it does not perform a database commit or close command, and<br />

therefore does not release any database locks that have been set.<br />

1-234 v

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!