Working with Null Status

You can set the current status list of a dimension to null (empty status) only when you have explicitly specified that you want null status to be permitted. You can give this permission in either of two ways:

Set the OKNULLSTATUS option to yes. This specification indicates that null status should be allowed whenever it occurs except when the IFNONE argument is present in a LIMIT command.

Use the NULL keyword in a LIMIT command to set the status of a particular dimension or valueset to null. You can do this by specifying TO NULL or KEEP NULL. This specification indicates that null status should be allowed for this LIMIT command only.

If you have not used either of these two methods to give permission for null status and you execute a LIMIT command that would result in null status, then the status is not changed to null when the command is executed. Instead, the status remains the same as it was before the command was issued.

You cannot use the IFNONE and NULL keywords in the same LIMIT command.

Managing Null Status in a Program

An IFNONE argument in a LIMIT command indicates that you do not want program execution to take its normal course when a dimension status is set to null. Therefore, when IFNONE is present, a branch is performed to the IFNONE label and the status is not set to null, even if OKNULLSTATUS is YES. If the NULL keyword is present together with IFNONE, then the inconsistency is signaled with an error.

Tip:

Using the IFNONE argument provides limited flexibility for handling null status because it simply branches to a label. For more flexibility, investigate the possibility of setting the OKNULLSTATUS option to control whether or not execution will branch when status is null, and the possibility of using a WHILE loop to test for null status.

Errors When Limiting Status to a Null Value

An error will not be signaled when you try to limit the status of a dimension or valueset that has no values, unless you explicitly list values that do not exist. For example, if you have not added any values to a newly defined dimension WEEK, then the following command does not cause an error.

LIMIT week TO FIRST 10

However, the following command does cause an error because PETE is not a value.

LIMIT week TO 'PETE'

Similarly, the following command causes an error because WEEK does not have a value at position 20.