Right, I skipped the answer to the first part of the question. Fortunately there is a very simple solution. Use the vtype function to test if CNT_&STATE is charater or numeric. vtype(cnt_&state); Returns 'N' if it is numeric and 'C' if it is character.
... View more