Set ASP Group (SETASPGRP)

Where allowed to run: All environments (*ALL)
Threadsafe: No
Parameters
Examples
Error messages

The Set Auxiliary Storage Pool Group (SETASPGRP) command sets the auxiliary storage pool (ASP) group for the current thread. Additionally, this command allows you to change the libraries in the library list for the current thread. If an ASP group had already been set, this command will remove the old ASP group from the current thread and set the specified ASP group for the current thread. Once the specified ASP group has been set for the current thread, all libraries in the independent ASPs in the ASP group are accessible and objects in those libraries can be referenced using regular library-qualified object name syntax. The libraries in the independent ASPs in the specified ASP group plus the libraries in the system ASP (ASP number 1) and basic user ASPs (ASP numbers 2-32) form the library name space for the thread. All libraries in the library list need to be in the new library name space or the library list is not changed and the new ASP group is not set.

Restrictions:

Top

Parameters

Keyword Description Choices Notes
ASPGRP ASP group Name, *CURUSR, *NONE Required, Positional 1
SYSLIBL System library list *CURSYSBAS, *SYSVAL Optional
CURLIB Current library Name, *CURSYSBAS, *CURUSR, *CRTDFT Optional
USRLIBL Libraries for current thread Single values: *CURSYSBAS, *CURUSR, *SYSVAL, *NONE
Other values (up to 250 repetitions): Name
Optional
Top

ASP group (ASPGRP)

Specifies the name of the auxiliary storage pool (ASP) group to set for the current thread. The ASP group name is the name of the primary ASP device within the ASP group.

This is a required parameter.

*CURUSR
The ASP group is set to the value defined for the Initial ASP group (INLASPGRP) in the default job description of the user profile that the thread is currently running under.
*NONE
Specify for the current thread to have no ASP group. The library name space will not include libraries from any ASP group. Only the libraries in the system ASP and any basic user ASPs will be in the library name space.
name
Specify the name of the primary ASP in the ASP group to be set for the current thread. All libraries from all ASPs in this ASP group will be included in the library name space.
Top

System library list (SYSLIBL)

Specifies the system part of the library list for the thread in which the command is entered.

*CURSYSBAS
The libraries in the system part of the library list of the current thread that are found in the system ASP (ASP number 1) or any configured basic user ASP (ASP numbers 2-32) are used as the new system part of the library list.
*SYSVAL
The system part of the library list of the current thread is set from the current value of system value QSYSLIBL.
Top

Current library (CURLIB)

Specifies the library to be used in the current library entry of the library list for the thread. If *CURUSR or a library name is specified and the library cannot be found in the new library name space, an error message is sent and the library list and ASP group are not changed.

*CURSYSBAS
The library name in the current library entry of the library list is used as the new current library if the library is found in the system ASP (ASP number 1) or any configured basic user ASP (ASP numbers 2-32). If the library name in the current entry is not found in the system ASP or any basic user ASP, the current library entry will be removed from the library list.
*CURUSR
The current library is set to the value defined for the Current library (CURLIB) attribute of the user profile that the thread is currently running under.
*CRTDFT
Changes the library list to remove any name from the current library entry. If objects are created specifying *CURLIB for the library name, library QGPL will be used.
name
Specify the name of the library that replaces the current library entry in the library list.
Top

Libraries for current thread (USRLIBL)

Specifies the libraries that are placed in the user part of the library list. If *CURUSR or a list of library names is specified and any of these libraries cannot be found in the new library name space, an error message is sent and the library list and ASP group are not changed.

Single values

*CURSYSBAS
The libraries in the user part of the library list of the current thread that are found in the system ASP (ASP number 1) or any configured basic user ASP (ASP numbers 2-32) are used as the new user part of the library list.
*CURUSR
The user part of the library list for the thread is set to the value defined for the Initial library list (INLLIBL) in the default job description of the user profile that the thread is currently running under.
*SYSVAL
The user part of the library list is set from the current value of system value QUSRLIBL.
*NONE
Changes the user part of the library list to remove all library names.

Other values (up to 250 repetitions)

name
Specify the names of the libraries to be used as the user part of the library list, in the order in which they are to be searched.
Top

Examples

Example 1: Set New ASP Group

SETASPGRP   ASPGRP(WAREHOUSE1) SYSLIBL(*SYSVAL)  CURLIB(*CURUSR)
            USRLIBL(*CURSYSBAS)

This command will set the auxiliary storage pool (ASP) group for the thread in which the command runs to be WAREHOUSE1. This will change the library name space for the thread to include all libraries in any of the independent ASPs in the ASP group identified by the independent ASP device named WAREHOUSE1. The system part of the library list will be set from system value QSYSLIBL. The current library entry of the library list will be set from the Current library value defined in the user profile that the thread is currently running under. The user part of the library list will be set using the current user part of the library list and removing any libraries that are not found in the system ASP or configured basic user ASPs.

Example 2: Set to No ASP Group

SETASPGRP   ASPGRP(*NONE)  SYSLIBL(*CURSYSBAS)  CURLIB(*CRTDFT)
            USRLIBL(*NONE)

This command will remove any ASP group for the thread in which the command runs. This will change the library name space for the thread to include only those libraries in the system ASP (ASP number 1) and basic user ASPs (ASP numbers 2-32). The system part of the library list will be set using the current system part of the library list and removing any libraries that are not found in the system ASP or configured basic user ASPs. The current library entry of the library list will be changed to be empty which will cause library QGPL to be used as the current library. The user part of the library list will be changed to be empty.

Top

Error messages

*ESCAPE Messages

CPFB8E9
ASP group &1 not set for thread &2.
Top