IBM Support

Creating/Changing/Retrieving a User Space (*USRSPC) on IBM® iSeries™ Family of Servers

Troubleshooting


Problem

This document describes and contains three commands that can be used to create, change, and retrieve a User Space (*USRSPC) on the IBM® iSeries™ family of servers.

Resolving The Problem

This document describes commands that will allow users to handle a User Space (*USRSPC) on the IBM® iSeries™ family of servers. The commands are CRTUSRSPC, CHGUSRSPC, and RTVUSRSPC. The CRTUSRSPC and CHGUSRSPC commands can be used from the IBM® OS/400® or IBM® i5/OS™ command line or can be included in a High Level Langages program (HLL), while the RTVUSRSPC command is allowed to run only inside a HLL program.

Caution: The following commands are provided on an unsupported, as is basis.

Prompting on the CRTUSRSPC command displays the following:

                         Create User Space (CRTUSRSPC)                        
                                                                               
Type choices, press Enter.                                                    
                                                                               
User Space . . . . . . . . . . .                 Name                          
  Library  . . . . . . . . . . .     *CURLIB     Name, *CURLIB                
Extended attribute . . . . . . .   *NONE         Name, *NONE                  
Initial size in bytes  . . . . .   4096          1-16776704                    
Initial value  . . . . . . . . .                 Hexadecimal value            
Authority  . . . . . . . . . . .   *LIBCRTAUT    *ALL, *CHANGE, *EXCLUDE...    
Text 'description' . . . . . . .   *NONE                                      
                                                                               
Replace  . . . . . . . . . . . .   *NO           *YES, *NO                    
User Space Domain  . . . . . . .   *DEFAULT      *DEFAULT, *SYSTEM, *USER      
Transfer size (in pages) . . . .   0             0-32                          
Optimum space alignment  . . . .   0             0, 1                          

Prompting on the CHGUSRSPC command displays the following:

                         Change User Space (CHGUSRSPC)        
                                                             
Type choices, press Enter.                                    
                                                             
User Space . . . . . . . . . . .                 Name        
  Library  . . . . . . . . . . .     *CURLIB     Name, *CURLIB
Starting position  . . . . . . .   1             1-16776704  
Length of data . . . . . . . . .   64            1-16776704  
Input data . . . . . . . . . . .                              
Force changes to ASP . . . . . .   0             0, 1, 2      

Prompting on the RTVUSRSPC command displays the following:

                        Retrieve User Space (RTVUSRSPC)        
                                                               
Type choices, press the Enter key.                                      
                                                               
User Space . . . . . . . . . . .                 Name          
  Library  . . . . . . . . . . .     *CURLIB     Name, *CURLIB  
Starting position  . . . . . . .   1             1-16776704    
Length of data . . . . . . . . .   64            1-16776704    
CL var for RCVDTA (1-16776704)                   Character value

An example of running the CRTUSRSPC and CHGUSRSPC commands from the OS/400 or i5/OS command line follows:

CRTUSRSPC USRSPC(QTEPM/TEST) INITVALUE(C1) TEXT('Testing...')

Press the Enter key.

CHGUSRSPC USRSPC(QTEMP/TEST) STRPOS(150) LENGTH(22) INPDTA('Testing *USRSPC change')

Press the Enter key.

The following program is an example of how to use the CRTUSRSPC, CHGUSRSPC and RTVUSRSPC commands inside a HLL program. This program can be submited or can be run from the OS/400 or i5/OS command line:

 BEGIN:      PGM

             DCL        VAR(&DATA) TYPE(*CHAR) LEN(9999)

             CRTUSRSPC  USRSPC(QTEMP/TEST) INITVALUE(C1) +

                          TEXT('Testing...')                                        
              .............................................                          
              .............................................                          
              .............................................                          
                                                                                     
             CHGUSRSPC  USRSPC(QTEMP/TEST) STRPOS(150) LENGTH(22) +                  
                           INPDTA('Testing *USRSPC change')                          
              .............................................                          
              .............................................                          
              .............................................                          
                                                                                     
             RTVUSRSPC  USRSPC(QTEMP/TEST) STRPOS(150) LENGTH(10) +                
                           RCVDTA(&DATA)                                              
              .............................................                          
              .............................................                          
 END:        ENDPGM                                                                

Restrictions:

The command RTVUSRSPC is only allowed to run in the following environments:

*BPGM
*IPGM

The CRTUSRSPC/CHGUSRSPC/RTVUSRSPC objects are in a save file that contains the following:

                       Display Saved Objects - Save File                      
                                                                             
Library saved  . . . :   QTEMP                 Release level  . . . :   V5R1M0
ASP  . . . . . . . . :   1                     Data compressed  . . :   Yes  
Save file  . . . . . :   USRSPCCMDS            Objects displayed  . :   3    
  Library  . . . . . :     MATIAS              Objects saved  . . . :   3    
Records  . . . . . . :   37                    Access paths . . . . :   0    
Save command . . . . :   SAVOBJ                                              
Save active  . . . . :   *NO                                                  
Save date/time . . . :   04/25/05   16:16:58                                  
                                                                             
Type options, press Enter.                                                    
  5=Display saved data base file members                                      
                                                                             
Opt  Object             Type     Attribute     Owner         Size (K)   Data  
     CHGUSRSPC          *CMD                   MATIAS               4   YES  
     CRTUSRSPC          *CMD                   MATIAS               4   YES  
     RTVUSRSPC          *CMD                   MATIAS               4   YES

Attached is the save file (V5R1/V5R2/V5R3 compatible):

usrspccmds.savf

To restore the objects, send the save file to your system and run the following command from the OS/400 or i5/OS command line:

RSTOBJ OBJ(*ALL) SAVLIB(QTEMP) DEV(*SAVF) SAVF(QGPL/USRSPCCMDS) RSTLIB(QGPL)

Press the Enter key.

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.1.0"}]

Historical Number

376430549

Document Information

Modified date:
18 December 2019

UID

nas8N1015565