Data Related
These are SPECIAL statements that abort interviews, store a respondent’s browser information, send or retrieve data from the global and local scratch areas, write from an external file into the data, write the station number or LDEV into the data and saves text into data.
Valid Subtypes
- Abort_Interview
- Abort_Interview_No_CR
- Browser_Information
- Data_To_Global_Scratch
- Data_To_Local_Scratch
- From_Global_Scratch_To_Data
- From_Local_Scratch_To_Data
- Load_File_To_Data
- Save_Station_Number
- Save_Text_Line_To_Data
ABORT_INTERVIEW
Shortform: SPC,ABORT
This command causes the interview to terminate, without saving the data. Use caution with this, as you may want to save the data from terminated interviews for counts, etc. SPECIAL,ABORT statements should be controlled by a GOTO statement (skipping to or around them) or IF conditions. No data location or width can be specified on the question label line.
EXAMPLE:
{ TERM_CASE: !IF OVERQUOTA(YES) !SPECIAL,ABORT_INTERVIEW }
A SPECIAL,ABORT,ONLY_CHILD statement allows you to abort from a CALL questionnaire and return to the parent. (See Call Questionnaire for more information).
NOTE: A normal SPECIAL,ABORT in a CALL questionnaire will just return to the calling parent questionnaire as well. For now, the ONLY_CHILD option is supported for back compatibility. If you do want to abort all the way out of the calling parent questionnaire, then you will need to set a flag in the local scratch area and check it on the return to the parent.
ABORT_INTERVIEW_NO_CR
Shortform: SPC,ABORTINTERVIEWNOCR
This command is the same as the ABORT_INTERVIEW command except that it immediately goes into the next interview instead of going to the between screen interviewer prompt. This is typically used to keep interviewers from logging out or spending time on the between interview screen.
BROWSER_INFORMATION
Shortform: SPC,BROWSERINFO
The SPECIAL,BROWSER_INFORMATION statement collects information about web based surveys.
The syntax for the SPECIAL,BROWSER_INFORMATION question type is:
!SPECIAL,BROWSERINFO,<suboption>
Valid Suboptions
- ADDRESS option gets the first 120 characters of the IP address (the Internet address that the client browser is coming from).
- Shortform: SPC,BROWSERINFO,ADDRESS
- INFO option gets up to 200 characters of the user agent string (UA), which provides additional information about browser type, version, and operating system.
- Shortform: SPC,BROWSERINFO,INFO
DATA_TO_GLOBAL_SCRATCH
Shortform: SPC,TOGLOBALSCRATCH
This command puts information in the global scratch area. The global scratch area is a place in the quota file used to hold things other than quota type numbers, e.g., text to be displayed, a Yes/No switch, or other information. This holds across the whole system if you are using a network or mini-computer base. It acts like the SPECIAL, DATA_TO_LOCALS_CRATCH if using a standalone system, except it will stay in memory until specifically changed.
You must specify the “to location” in the scratch area and the “from question or location”. A supervisor might want to use this scratch area to store a message that displays at the end of the interview or to set a switch that determines the product asked about that day.
The syntax for the SPECIAL,DATA_TO_GLOBAL_SCRATCH question type is:
!SPECIAL,TO_GLOBAL_SCRATCH,to position (scratch area),from question or location,length
The global scratch area position may be from 1 to 40. The maximum length is 40. No data location or width can be specified on the question label line.
EXAMPLE:
{ PUT_GLOBAL: !SPECIAL,TO_GLOBAL_SCRATCH,1,[32],8 }
This statement says store the data from column 32 for a length of 8 in the global scratch area starting at position 1.
SPECIAL,DATA_TO_GLOBAL_SCRATCH statements are used in conjunction with SPECIAL,FROM_GLOBAL_SCRATCH_TO_DATA statements.
Once data has been stored with the SPECIAL, DATA_TO_GLOBAL_SCRATCH, the SPECIAL,FROM_GLOBAL_SCRATCH_TO_DATA can get the data and the value could be checked.
DATA_TO_LOCAL_SCRATCH
Shortform: SPC,TOLOCALSCRATCH
The SPECIAL,DATA_TO_LOCAL_SCRATCH command puts information into the local scratch area. This is a place that holds information between interviews for a particular interviewer. You must specify the “to location” in the scratch area and the “from question or location”. This is often used to ask a question in the first interview of the session (e.g., are you interviewing about compact cars or luxury cars?), then controlling later interviews with that information without having to re-ask the question. The information is gone when the interviewer quits that interviewing session.
The syntax for the SPECIAL,DATA_TO_LOCAL_SCRATCH question type is:
!SPECIAL,DATA_TO_LOCAL_SCRATCH,to position (scratch area),from label or location,length
The local scratch area position may be from 1 to 1000. No data location or width can be specified on the question label line.
EXAMPLE:
{ PUT_LOCAL: !SPECIAL,DATA_TO_LOCAL_SCRATCH,1,[52],5 }
This statement says to store the data from column 52 for a length of 5 in the local scratch area starting at position 1.
SPECIAL,DATA_TO_LOCAL_SCRATCH statements are used in conjunction with SPECIAL,FROM_LOCAL_SCRATCH_TO_DATA statements and/or the LOCAL_SCRATCH function.
Once data has been stored with the SPECIAL,DATA_TO_LOCAL_SCRATCH, the SPECIAL,FROM_LOCALS_SCRATCH_TO_DATA can get the data and/or the LOCAL_SCRATCH function can be used to check its value. The local scratch area is also useful for CALL questionnaires to move data between the main and sub-questionnaires, and also for Coding mode, or multiple phone calls (interviews) to the same person.
FROM_GLOBAL_SCRATCH_TO_DATA
Shortform: SPC,FROMGLOBALSCRATCH
This command retrieves information from the global scratch area, which had been stored there with a SPECIAL, DATA_TO_GLOBAL_SCRATCH statement in this or a prior interview.
The syntax for the SPECIAL, FROM_GLOBAL_SCRATCH_TO_DATA question type is:
!SPECIAL,FROM_GLOBAL_SCRATCH_TO_DATA,to label or location,from position (scratch area),length
The global scratch area position may be from 1 to 40. The maximum length is 40. No location or width can be specified on the question label line.
EXAMPLE:
{ GET_GLOBAL: !SPECIAL,FROM_GLOBAL_SCRATCH_TO_DATA,MESSAGE,1,8 }
This says to get the information from location 1 of the global scratch area for a length of 8 and store it in the location of the question labeled MESSAGE.
NOTE: For this subtype, the SPECIAL statement itself can be the receiving question in the data. Specify a label on the question so that you can back-reference it later. Leave ‘to location’ blank, but be sure to add the comma placeholder for the missing parameter.
EXAMPLE:
{ FONENUMBER: !SPECIAL,FROM_GLOBAL_SCRATCH_TO_DATA,,1,10 }
This means that you no longer need to set up a VARIABLE,USE_PREVIOUS or FIELD,USE_PREVIOUS using the same data location as the SPECIAL in order to back- reference information placed in the data using one of these statements.
FROM_LOCAL_SCRATCH_TO_DATA
Shortform: SPC,FROMLOCALSCRATCH
This command retrieves information from the local scratch area, which had been stored there with a SPECIAL,DATA_TO_LOCAL_SCRATCH statement from this or a prior interview.
The syntax for the SPECIAL,FROM_LOCAL_SCRATCH_TO_DATA question type is:
!SPECIAL,FROM_LOCAL_SCRATCH_TO_DATA,to label or location,from position (scratch area),length
The local scratch area position may be from 1 to 1000. No data location or width can be specified on the question label line.
EXAMPLE:
{ GET_LOCAL: !SPECIAL,FROM_LOCAL_SCRATCH_TO_DATA,SAVEDATA,1,5 }
This says to get the information from location 1 of the local scratch area for a length of 5 and store it in the location of the question labeled SAVEDATA.
NOTE: For SPECIAL subtype FROM_LOCAL_SCRATCH_TO_DATA, the SPECIAL statement itself can be the receiving question in the data. Specify a label on the question so that you can back-reference it later. You may not refer to it by just the label; you must refer to it by location. Leave ‘to location’ blank, but be sure to add the comma placeholder for the missing parameter.
EXAMPLE:
{ FONENUMBER: !SPECIAL,FROM_LOCAL_SCRATCH_TO_DATA,,1,10 } { SHOW_LOCAL: The information in the local scratch is: \|FONENUMBER !DISPLAY }
This means that you no longer need to set up a VARIABLE,USE_PREVIOUS or FIELD,USE_PREVIOUS using the same data location as the SPECIAL in order to back- reference information placed in the data using one of these statements.
LOAD_FILE_TO_DATA
Shortform: SPC,LOADFILETODATA
This command allows you to load the contents of a file into the data and the answer array. It happens in “real time” so if you change the contents of the file it will load the new data.
EXAMPLE:
{ NEWPROD: prod.xxx !SPECIAL,LOAD_FILE_TO_DATA } { NEWPRODB: Here is a description of the product: \:Newprod: What do you think of it? !TEXT }
This would cause the contents of the file prod.xxx to be displayed as the response to “Newprod”.
SAVE_STATION_NUMBER
Shortform: SPC,SAVESTATIONNUMBER
This command puts the station number or LDEV of the interviewer into the data. This can come from the LDEV variable (DOS or UNIX) the TTYINFO file (UNIX) or the CFG file (DOS standalone). The default length is 5.
SAVE_TEXT_LINE_TO_DATA
Shortform: SPC,TEXTTODATA
This command causes text on the text line of this question to be saved in the data and as a response in the answer array. Text controllers such as back-references may be used to fill in values (i.e., text of a response from a prior question using \:label:). If you have multiple text lines, the nth line (n being determined by a controller) of text on this question will be saved. The default width is the longest line of text; the maximum width is 2100. You can change this width on the question label line. Making this width smaller than the longest text line will only affect the information stored in the data, not the text available for back-referencing.
The syntax of the SPECIAL,SAVE_TEXT_LINE_TO_DATA question type is:
text line 1 ... text line n !SPECIAL,SAVE_TEXT_LINE_TO_DATA, controlling label or location
The SPECIAL,SAVE_TEXT_LINE_TO_DATA statement requires one or more lines of text and can use a controller question label or location. If no controller is specified, then you can have only one line of text (first line) and it will be what is saved. This is the ONLY way to get text stored in the data, there are no GENERATE statements or other statements to do so.
EXAMPLE:
{ NEWTEXT: Put this in data !SPECIAL,SAVE_TEXT_LINE_TO_DATA }
In this example, “Put this in data” will appear in the question label NEWTEXT.
In the following example the storing of the text is a response to a single response FIELD question in the data. Notice the use of the length parameter as the program will assign a length based on the text on the back-reference otherwise.
EXAMPLE:
{ TYPELIKE: What type do you like the most? !FIELD 1 Type 1 2 Type 2 3 Type 3 4 Type 4 5 Type 5 } { TEXTRESPONSE: .30 \:TYPELIKE: !SPECIAL,SAVE_TEXT_LINE_TO_DATA }
The SPECIAL,SAVE_TEXT_LINE_TO_DATA statement will save the nth line of its text, corresponding to the number stored in the control question.
EXAMPLE:
{ SAVETEXT: first second third fourth fifth !SPECIAL,SAVE_TEXT_LINE_TO_DATA,TIMES } { Q1: What did you do the \:SAVETEXT: time you ate there? ...
This SPECIAL, SAVE_TEXT_LINE_TO_DATA statement will check the numeric response to the question TIMES and save the line of text corresponding to that number. If the response to TIMES is 3, line three (third) will be saved. At a future question you could then back-reference the text line stored.
NOTE: The SPECIAL, SAVE_TEXT_LINE_TO_DATA statement requires a specific width if it sees back-references or a backslash in the text. This is because if you don’t, the statement is assigned a width based on the text it sees, not on the “filled in” text from the backslash or back-reference.