UNLOCK

This command is used for local unlocking of Natural source objects in a Natural mainframe environment.

It is used to view source objects that are locked and to unlock them if required. This command is recommended for use by the Natural administrator only. However, the administrator can enable the use of this command for each user profile in Natural Security.

Notes:

  1. As a prerequisite for using the UNLOCK system command, the profile parameter SLOCK must be set to PRE.
  2. If the number of locked records found is high, it may happen that the list displayed is not sorted. Remedial action: Increase the size of the work buffer used by the sort program; see keyword subparameter WRKSIZE of profile parameter SORT.

This document covers the following topics:

For further information, refer to Locking of Source Objects in the Editors documentation and profile parameter SLOCK in the Parameter Reference.

See also Object Naming Conventions in the Using Natural documentation.


Unlocking Natural Objects

If the system command UNLOCK is used without parameters, a screen appears where you can enter the parameters.

UNLOCK

The following shows the direct command syntax for unlocking Natural objects.

UNLOCK [NATURAL] [OBJECT] object-name
  [TYPE object-type]
  [LIBRARY library-name]
  [DBID dbid] [FNR fnr]
  [PASSWORD password] [CIPHER cipher]
  [USER locked-by]
  [DATE locked-on [locked-on2]]

Parameter Descriptions

The object name must be defined in each case. If any of the other parameters is not specified, the corresponding default value will be used.

Parameter Format/Length Default Value Description
object-name A33 * The name of the object to be unlocked. Asterisk notation (*) or ">" can be used.
object-type A1 *
Natural object types:

In place of object-type, you may specify one of the object type codes shown below or an asterisk (*).

P Program
4 Class
N Subprogram
S Subroutine
7 Function
8 Adapter
C Copycode
H Helproutine
T Text
M Map
L Local Data Area
G Global Data Area
A Parameter Data Area
V DDM (View)
library-name A8 * The name of the library where the locked object is in. Asterisk notation (*) can be used.
dbid A5 current database ID The database ID of the defined library. Specify asterisk (*) or in format N5.

When asterisk notation (*) is used, only the current FNAT, FUSER and FDIC system files are scanned.

fnr A5 current file number The file number of the defined library. Specify asterisk (*) or in format N5.

When asterisk notation (*) is used, only the current FNAT, FUSER and FDIC system files are scanned.

password A8 blank If used, the password for the specified system file (dbid and fnr).

Needs not to be specified, when the dbid and fnr of the current FNAT or FUSER is used.

cipher A8 blank If used, the cipher key for the specified system file (dbid and fnr).

Needs not to be specified, when the dbid and fnr of the current FNAT or FUSER is used.

locked-by A8 current user ID

or asterisk (*) with batch mode and security flag "F"

The ID of the user who caused the object to be locked. Asterisk notation (*) can be used.

If Natural Security is used, it can be changed only if the security unlock flag is set to "F" (forced unlock) in the Natural Security user profile.

locked-on A10 blank The two date parameters are available to provide for the different date formats:

2005-09-28 (date format according to the DTFORM profile parameter)
2005-09-28 11:27:20
Today
Today + nnnn
Today - nnnn
Yesterday

locked-on2 A8

Note:
Locking can also be enabled locally on a mainframe server based on Natural for Mainframes. In this case, the following limitations apply: The application-name cannot be used as a selection criterion. For dbid and fnr, the current FNAT and FUSER system files are searched if asterisk notation (*) is used.

Parameter Processing and Display of Objects Found

If the parameter(s) specified is (are) valid and a complete object name is specified and if the corresponding object is found and it was locked by the current user, this object is unlocked immediately and a corresponding message is displayed. This applies under the condition that the object name is specified directly without using asterisk notation (*) and the current user tries to unlock his own locked records.

If any of the parameters specified is invalid or if no objects are found, the unlock screen with an error message will appear.

In the following cases, the locked objects found are listed on the screen where they can be unlocked using the line command U (see below):

  • if you used asterisk notation (*) or ">" (where applicable),

  • if you did not specify a specific object name.

Note:
When asterisk notation (*) is used for object type and library, the locked DDMs have also to be listed by scanning the current FDIC system file.

Unlock List

Function Keys

The unlock list provides the following function keys:

PF1 Help Invoke help.
PF3 Exit Return to unlock list.
PF6 -- Top of list.
PF7 - Page backward.
PF8 + Page forward.
PF9 ++ End of list.
PF10 < First part of information (type, library, database ID, file number).
PF11 > Second part of information (locked by, locked on).
PF12 Cancel Cancels the UNLOCK command.

Line Command

U In the Cmd column of the unlock list, you can enter the command U in a single line or in multiple lines to unlock the corresponding object(s). Successful unlocking is indicated by an "unlocked" message in the Message column.

Batch Processing

If no error occurred, all locked objects found are unlocked and a corresponding message appears.