QDS SAS Transport Format Program Conventions
Special Format Processing for QDS Element Types
- Yes/No: Displays unique Yes and No labels and Special Codes.
- Gender: Displays unique Male and Female labels and Special Codes.
- Check Each Component: Displays unique Check Each labels with Special Codes. Checked is displayed as Yes. Unchecked is displayed as No. Check Each values are grouped together. Note: Check Each composite variables do not have formats.
- Pick One: Displays Pick One labels and Special Codes. Pick One values are grouped together. Pick One Response Cards are handled in the same manner as regular Pick One variables.
- Numeric Scale: Displays labeled numeric scale values and Special Codes. Numeric scale items are grouped together. Numeric scales not associated with a Response Card have labels for the minimum and maximum values only; scales associated with Response Cards have labels for all points.
- Automatic Variables: Do not have formats.
- Composite Variables: Composite dates, times, and timespans do not have formats.
- Text Variables: Displays formats for Special Codes. Text variables with no Special Codes defined do not have formats.
The SAS format index file (*.SAS) generated by the Warehouse Manager contains the appropriate FORMAT statement for the exported SAS Format Library.
Format Naming Conventions
In the FORMAT statement, variables with identical format values are grouped together. The format name for a group of variables will be the first one of the group. In the example below, JOB and FULLTIME are both assigned the format named JOB.
JOB
FULLTIME
JOB.
Text variables are listed last in the FORMAT statement. In keeping with SAS syntax requirements, text format names are preceded with a dollar sign ($).
If you have defined a variable in the QDS Design Studio with a name that ends in a numeric character, it will be replaced with a letter in the SAS format name as follows: 0=A, 1=B, 2=C, 3=D, 4=E, 5=F, 6=G, 7=H, 8=I, 9=J. If the designated rename would result in a duplicate format name, a new format name is created using the format "X#X," where # is a sequential number.
Format names for Response Card items will correspond to Response Card names, with the following exceptions. If the same Response Card is used for multiple variables with different combinations of allowed Special Codes, each unique occurrence of the Response Card and corresponding Special Codes will have a separate format. The first occurrence will use the Response Card name for the format name; for each subsequent occurrence, the Format name is changed to "Z#Z," where # is a sequential number.
For example, for the Response Card LENGTH, the first occurrence of LENGTH is used with Don't Know set to 7, Not Applicable set to 8, and Refused set to 9. The second occurrence of LENGTH is used with Don't Know and Not Applicable disallowed and Refused set to 99.
In this situation, two Formats will be output:
- LENGTH: Don’t Know=7, Not Applicable=8, Refuse to Answer=9
- Z0Z: Refuse to Answer=99
If the Response Card name contains one or more dashes, the corresponding format name will include an underscore character in place of each dash in the original Response Card name.
If the first character of the Response Card name is a dash, it will be changed to the character W for the format name. If the Response Card name had more than eight characters, it will be truncated to eight characters. If truncating causes a duplicate Response Card format name, the Format name will be changed to "Z#Z," where # is a sequential number.