What can cause a U3998 abend when calling QUIKVSAM?

Document ID : KB000030699
Last Modified Date : 14/02/2018
Show Technical Document Details

QUIKVSAM provides native mode access to VSAM data sets, enabling you to support commonly used VSAM functions
with the minimum of effort. However, when developing an application using this tool, sometimes U3998 abends are
encountered without accompanying messages.

When this occurs, refer to chapter 7 in the Reference Guide to check the parameters on the QUIKVSAM CALL statement. 
Verify the right number of parameters are present for the function. 
Verify the parameters are in the right format.

For example, in this case the user did receive a message:

+jobname  QUIKVSAM SYSUT2OP DATASET NOT ALLOCATED. 

This was a results of this CALL statement:

CALL QUIKVSAM C'SYSUT2' C'OPEN' VSAM-COMM-AREA 

This CALL statement has the right number of parameters, but note that ?SYSUT2OP? in the message is concatenation
of 'SYSUT2' and first 2 characters of 'OPEN'.

The Reference Manual Page 7-17 specifies:

The length of the ddname operand is system dependent (VSE seven positions, MVS eight positions)
with the necessary spaces included for padding.

So adding 2 blanks after SYSUT2 before the closing quote resolved the problem:

CALL QUIKVSAM C'SYSUT2  ' C'OPEN' VSAM-COMM-AREA