NUM_ITEMS Method

Returns the number of data items in a dictionary.

Applies to:Dictionary Object
See:For more information, see Using Dictionary Objects.

Syntax

Required Arguments

number-items

specifies a variable that stores the number of items returned by the method.

object-reference

specifies the name of the object.

Details

The NUM_ITEMS method returns the number of data items that are stored in a dictionary. The number of items is returned in the assignment variable number-items.

Example

proc fcmp;
   declare dictionary d;
   n = .;
   d[1] = 25; d[2] = 'string';
   n = d.num_items();
   put n=;
run;

The preceding statements produce this result:

n=2
Last updated: August 19, 2026