Techniques for Using the Quota System

There are three ways of specifying quotas.

Standard Quotas

  1. These are easy to read and easy to keep track of.
  2. They have the disadvantage: if there are many of them, they need a separate statement for each quota check.
  3. You must recompile the questionnaire when you have target quota value changes during interviewing.
  4. You can have up to 3,000 standard quota names.


  1. This uses three separate counters for each quota: the quota value itself, a target quota (the number you are trying to reach) and a resettable quota.
  2. This use of quotas only allows 1,000 quotas, but has the advantage of ease of readability and easy execution of changes in the target values, without recompiling the questionnaire.
    1. A variation of this would require using the SET_QUOTA compiler command to have only some of the quotas in this multiple mode.
    2. This allows you access to all 3,000 quotas.


  1. These are referenced by number, not by quota name.
  2. You can have up to 2,000,000 numbered quotas.
  3. If properly written, you can update all your numbered quotas with as few as one to five statements.
  4. The disadvantage: numbered quotas are more difficult to set up and track.
  5. You will probably have to develop your own quota list to be used for reference by the supervisor(s) and/or interviewers.

Creating the Quota (QUO) File

When the specifications for a study are compiled by PREPARE, the file <studyname> with a QUO extension will be created in the local directory or group unless you have -QUOTA_FILE in your header statement. If there is an existing QUO file of the same name, PREPARE adds any new quota names to that file; any existing quota values are left alone. A quota is created for each quota name and initially set to 0 (or the target value, if using TRIPLEQUOTAS mode and the TARGET compiler command) or to the value specified on the SET_QUOTA compiler command.

If you add new quotas or rename old ones, the old quotas retain their values. To get rid of unused quotas, delete the old quota file before rerunning PREPARE; on the other hand, you should be careful of removing it if you want to retain the existing values. When recompiling with added quotas, copy the QUO file locally so it will get the changes made to it. Then you can move it back to where it came from. If you forget to move it locally, a brand new QUO file will be created. If you recompile and make a new QUO file with new or differently named or ordered quotas, you cannot use the old quota file for interviewing. Use the QUOTAMOD utility’s OUT and IN options to read the old value(s) in.

Using Named Quota Statements in the Questionnaire

A questionnaire that uses quotas is generally set up in the following sequence:

  1. Data entry, GENERATE, or PHONE questions get initial information for quotas
  2. Condition(s) to check for full quotas
  3. Statement(s) to display information about full quotas, and end the interview
  4. The body of the questionnaire
  5. Statement(s) to increment the quotas

With this sequence, the quota is checked before the body of the interview is conducted. If the quota is full, you could display which quota is full and end the interview. If the quota is not full, the interview is conducted and the quota is incremented.

In the following example, the number of respondents desired is 1000, 250 from each of four cities. QCITY is the control question. The next question checks for any full quotas and terminates the interview if there is one. Following the interview are the quota-incrementing questions.


''Choose which quota
Which city are you calling?
1 New York
2 Chicago
3 Atlanta
4 San Francisco }

''Continue the interview if the quota is not full

''Display quota that is full
Thank the respondent and report that the \:QCITY: QUOTA is FULL.

''Terminate, don't do the interview



''Increment quota at end of completed interview



At the end of the interview, the appropriate quota is incremented. If the interviewer backs up over the quota incrementing statements, the quotas will be decremented. You want to keep the increment statements at the end of the questionnaire typically to ensure that the respondent completes the interview.

You can increment as many quotas as you like in an interview. A separate quota statement is entered for each quota, with a relevant condition.

The quota will be updated when the interview is completed and the data case is written to disk, unless you use the NOW option on the quota statement, in which case it will be updated immediately. This was used on the quota OVER_QUOTA in the example above, since we were then aborting them; if we didn’t use NOW on them, their quota value would never change since they write no data to disk. All quotas not incremented NOW store the increment in memory until the data case is written to disk. The MODQUOTA and MODQUOTN functions will give you information on quotas not incremented NOW.

Notice the QUOTA functions on the IF statements above. The values picked up with the QUOTA function are the values of the quotas at the beginning of the interview. The QUOTA function is not affected by any QUOTA statements within the specifications. Use the READ_NAMED_QUOTAS compiler command to see the current value in the shared systems.

Updating the Quota File

Survent will not start up unless the QUO file matches the current QFF file. That is, if you have added quota references, deleted quota references, changed the name or changed the order of your quota references in the spec file, and you continue to try and use your old quota file, you will get a blow error. You must recompile, updating the current QUO file, or else use the QUO file you made when you last compiled.

Survent saves quotas as positional items. If you made any of the above changes, you would most likely cause the program to update the wrong quotas, which would also be very difficult to figure out. This feature prevents that problem from occurring.

When you PREPARE a spec file, a CRC check (cyclic redundancy check) is done on the names block of the quota file built, and is stored in the QFF file. When you go to run Survent, the CRC value in the QFF file must match the value in the QUO file you use, or the program will blow.

The TIMESTAMP option on the header statement, if used, means you must use the quota file you build when you compiled when you start Survent. A time stamp is put in the QUO file and the QFF file when you compile, and Survent will compare them and only let you continue if they match. This is to prevent people from compiling a questionnaire and loading it to be interviewed without updating the quota file at the same time.

NOTE: If you do not use the TIMESTAMP option, the program still does a CRC check to assure that the quotas you are using are correct. It just does not verify that the quota file was the exact one you compiled the questionnaire with.

To make a valid quota file, do one of the following:

  1. During a break in interviewing, copy the current updated quota file to the directory you compile the new questionnaire in, and recompile the questionnaire.
    1. Then, copy the updated quota file back to the interviewing directory.
    2. This will cause the new quotas to be added and the questionnaire file to properly address the quotas.
    3. Compile the new questionnaire.
  2. Run QUOTAMOD and use the OUT option to extract the current values from the in-use quota file.
    1. Move back to the directory you compiled the questionnaire in, run QUOTAMOD and use the IN option to add the quota values to the quota file with the new names in it.
    2. Copy this quota file to the interviewing directory and restart interviewing.