Adding a special value for "don't know" answers ?

Discussions about CSEntry
Forum rules
New release: CSPro 8.0
Post Reply
olivia.ri
Posts: 1
Joined: January 24th, 2013, 7:05 am

Adding a special value for "don't know" answers ?

Post by olivia.ri »

Hello,

I am putting together a data entry application and don't understand how to add a special value for "don't know" responses in the entire dictionary? The code for that '888' should be able to be entered in any field. I guess there is a general way to do so rather than increasing the length of all variables to at least 3 and adding the code to each variable value set ?

I ahve read about the three special values in the CSPro language: missing, notappl, and default. The manual says "To properly utilize this special value,
you must create a value set for this item in the dictionary, setting one of the value set entries to the special value "missing."" but I don't quite get how to do so.

Thanks a lot for your help,
Olivia
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: Adding a special value for "don't know" answers ?

Post by Gregory Martin »

If your "don't know" value is 888, then all of your fields will have to be at least three digits to store that code. Due to the fixed-length nature of CSPro data files, each item must be as wide as the maximum value that will be stored in the field.

Often people have different codes for fields of different length (like 9, 99, 999, etc.).

The most common special value that is defined is the Missing code. In your dictionary, while editing the value set for an item, you can add a Missing code by specifying the value in the far-right column. However, I wouldn't use special values unless you're planning to work with them in logic. For example, in the above scenario, Missing might be 9 for one field and 99 for another field. In that case, you could write generalized logic like this:
if FIELD_NAME = Missing then
    
// ...
endif;
That code would apply to fields with value 9 (for fields of length 1) and value 99 (for fields of length 2).
Post Reply