Delete User Space

DltUsrSpace

The DltUsrSpace procedure deletes a *USRSPC (user space) object from the system.

The DltUsrSpace procedure can be used to delete a user space from the system. Once deleted, any information stored in the user space is permanently destroyed.

void DltUsrSpace(
 szUserSpace  21A    Const
)

See also: ChgUsrSpace, CrtUsrSpace

Parameters

szUserSpace
[input Char(21) const]  This parameter consists of two parts (1) in the first 10 positions, the name of the user space being deleted, and (2) in the second 10 positions, the name of the library in which the user space is located.  For example:
 
 *...v....1....v....2
'MYSPACE   QTEMP     '
 

An alternative syntax is also supported for the user space parameter. The alternate syntax allows you to specify the user space name similar to that of an OS/400 CL command, that is it may be qualified using qualified name syntax, as follows:

 *...v....1....v....2
'QTEMP/MYSPACE       '
 

The qualified user space name is MYSPACE in the QTEMP library. Either syntax is acceptable.

 
Any valid library name may be specified as well as the following special library names:

Return Value

If the user space is deleted, *ON is returned, otherwise, *OFF is returned.

If the function fails, check the XT_ERROR data structure's subfield XT_ERRMsgID for the error message ID indicating why the user space was not deleted.

Example

Normally, the command and user space name are the only values that need to be specified. For example:

.....DName+++++++++++EUDS.......Length+TDc.Functions++++++++++++++++++++++++++
     D szUS            C                   Const('QGPL/MYUSRSPC')
.....CSRn01..............OpCode(ex)Extended-factor2+++++++++++++++++++++++++++
     C                   CallP     DltUsrSpace(szUS)

The call to DltUsrSpace() deletes the user space named MYUSRSPC in the QGPL library.