Desktop User Guides > Professional > Interview scripting > Sample management > Sample management facilities > Standard scripts > Scripts in the Quotas folder
Scripts in the Quotas folder
The Quotas folder contains Sample Management scripts for use with projects that use quota control. The quotas can be based on questionnaire data, sample data, or a combination of both. Scripts are as follows.
This script is suitable for use with projects that require basic quota control as part of the authentication process and/or quota control within the questionnaire.
The example requires four quotas. The quotas for car ownership and internet access are Table Quotas based on questions in the questionnaire; the quotas for age are Expression Quotas based on data in each respondent's sample record, with one expression for respondents who are younger than 35 years of age and another for respondents who are aged 35 or older.
AuthenticateSampleRec attaches the sample record to the quota control system, tests quotas and pends all cells that apply to the respondent. Because only age is available at this point, only the appropriate age quota is pended. Respondents whose age quota is full and respondents who do not belong in any of the quotas fail the quota check and the appropriate pending counts are rolled back. These records are moved into the SM_REJECTED queue and the link to quota control is broken.
Respondents who pass the sample management quota check also pass authentication and proceed with the interview, where the other quota checks are made.
ReturnSampleRec tests the return code for each interview. If a respondent completes an interview (return codes 1 or 6), then any pending counts for that respondent are converted into completed counts. If an interview is returned with any other return code, it fails quota control and the pending counts for that interview are converted into rollbacks.
This script uses the “least full” quota feature to choose the two responses whose quota cells are the least full from the set of responses that the respondent chooses. For example, if the respondent chooses tea, coffee, and milk, and the tea quota has the greatest percentage of completed interviews of those three categories, then only the coffee and milk quotas will be pended for that interview. The remaining questions in the script are asked only for the responses that have been pended. If a respondent does not belong in any of the quota controlled cells or chooses only responses whose quotas have been filled, the interview is terminated.
This script illustrates how to pend a specific quota by name.
See also
Standard scripts