HPlogo QUERY/V Reference Manual: HP 3000 MPE/iX Computer Systems > Chapter 3 QUERY/V COMMANDS

SETLOCKS

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

Prevents automatic unlocking of a data set.

Syntax

   SET[LOCKS]

Discussion

The SETLOCKS command prevents the automatic unlocking of a data set after a retrieval, update, or REPORT command has been executed. Normally, QUERY locks a data set while these commands are executing, but not in the interim between commands. By issuing the SETLOCKS command, you can lock the data set during the time between commands. This ensures that retrieval information does not change before it is reported. Locking remains in effect until a RELEASE command is issued.

QUERY decides what data sets to lock based on the retrieval or updating command you use.

      >SETLOCKS  

      >PROC=PROCA 

      >FIND SALES.STOCK#>20 

      USING SERIAL READ

      6  ENTRIES QUALIFIED

      WARNING:LOCKS ARE BEING HELD

      >REPORT ALL

In the example above, locking takes place when the FIND command is entered and will remain in effect until a RELEASE command is entered. After a SETLOCKS command has been issued, QUERY provides a warning prompt following every command. If you enter a SETLOCKS command a second time you will receive the following message:

   SETLOCKS COMMAND ALREADY IN EFFECT

Locks incurred by any QUERY command following a SETLOCKS command will remain in effect until a RELEASE or EXIT command is entered, or until QUERY is aborted in either job or session mode. The SETLOCKS command overrides LOCKOPTION=OFF until the RELEASE command is issued, at which point LOCKOPTION will take effect again with the same value it had prior to the SETLOCKS command.

NOTE: The SETLOCKS command may impact other users of the data base(s). Locks should be released as soon as possible. Particular care should be taken when retrieving from multiple data sets or multiple data bases. Locking only takes place in modes 1, 2, and 5.
Feedback to webmaster