IBM Support

QUSLOBJ API PTF may expose improperly coded API calls

Troubleshooting


Problem

Changes have been made to the API QUSLOBJ via PTF at 7.4 (SJ03017) and 7.5 (SJ03163), and also in the GA version of the operating system for 7.6. The PTFs fixed a problem with the QUSLOBJ API when the third optional parameter group was specified.  For that problem, the optional parameter group 2 was specified correctly on the call to the QUSLOBJ API.   However, the specified parameter values of the optional parameter group 2, authority control and selection control, were ignored and were not used to determine which objects should be returned in the list.  With the changes to the QUSLOBJ API in the PTF, the parameters in optional parameter group 2 (parms 6 and 7) will be validated for the correct values.  The values specified in parms 6 & 7 will be used in determining which objects should be returned in the list. Because of this, the list returned by the API could be different than it was prior to the PTFs (if parms 6 & 7 were coded). 
 
The changes to the API may expose coding errors in programs that have been calling the API incorrectly for years.  With the new version of the API, it can cause runtime errors.  The errors could be
  MCH3601  Pointer not set for location referenced
  MCH0601  Space offset is outside current limit
  CPF22F9   Call level not valid
  CPF24B4   Severe error while addressing parameter list
  Other errors are possible as well.

These errors could be in home grown applications or third party applications.  This has been seen mostly in C applications.

The issue occurs when all optional parameter groups have been specified on the QUSLOBJ API (all 8 parameters) and the parameters in optional parameter group 2 were not specified correctly (either NULL or an incorrect value).  The Length fields in parameters 6 & 7 need to either be set to zero if you are not using the parameter or the correct length of the structure.

From the API Doc 
https://www.ibm.com/docs/en/i/7.4.0?topic=ssw_ibm_i_74/apis/quslobj.html :

Length of authority control format. The total length of the authority control format. The length can be 0 bytes to indicate that no authority control information is provided. Otherwise, the minimum size is 48 bytes, which allows for one object and one library authority. An error is returned if the length specified is less than the minimum and not 0.

Length of auxiliary storage pool (ASP) control format. The total length of the auxiliary storage pool (ASP) control format. The length can be 0 bytes to indicate that no auxiliary storage pool (ASP) control information is provided. Otherwise, the length must be 24 bytes. An error is returned if the length specified is not 24 or 0.

Length of selection control format. The total length of the selection control format. The length can be 0 bytes to indicate that no selection control information is provided. Otherwise, the minimum size is 21 bytes, which allows for one status value. An error is returned if the length specified is less than the minimum and not 0.

Example of incorrect API call passing NULLs:

  QUSLOBJ("APIUSRSPC QTEMP     ",           /* User space name           */
         "OBJL0100",                        /* Format name               */
         "*ALL      QSYS      ",            /* Object Info               */
         "*LIB      ",                      /* Object type               */
         &err,                              /* Error Code                */
         NULL,                              /* Authority Control         */
         NULL,                              /* Selection Control         */
         &aspCtl                            /* ASP Control               */
      );

Example of a correct call passing a "structure" with the first "length" subfield set to zero:

   QUSLOBJ("APIUSRSPC QTEMP     ",          /* User space name           */
         "OBJL0100",                        /* Format name               */
         "*ALL      QSYS      ",            /* Object Info               */
         "*LIB      ",                      /* Object type               */
         &err,                              /* Error code                */
         0x00000000,                        /* Authority Control         */
         0x00000000,                        /* Selection Control         */
         &aspCtl                            /* ASP Control               */
      );
For third party applications, you need to contact your third party support to get a fix.  Many of them already have fixes, but some may not yet have a fix, and you will have to wait until they provide one. 

For 7.4 & 7.5, as a temporary work around, you can remove the PTF 7.4 (SJ03017), 7.5 (SJ03163).  Once you have the fix, you can reapply the PTF.

For 7.6, the change to QUSLOBJ is in the base operating system, so there is no PTF to remove.  You will need the fix from your programmer or your third party provider.





 

[{"Type":"MASTER","Line of Business":{"code":"LOB68","label":"Power HW"},"Business Unit":{"code":"BU070","label":"IBM Infrastructure"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m3p000000hB4rAAE","label":"API"}],"ARM Case Number":"","Platform":[{"code":"PF012","label":"IBM i"}],"Version":"All Versions"}]

Document Information

Modified date:
17 April 2025

UID

ibm17231125