Data Model > Available DSCs > Delimited Text DSC > Variable definitions when writing to a .csv file
 
Variable definitions when writing to a .csv file
This topic describes how the Delimited Text DSC maps Metadata Model (MDM) variable types to text values when writing to a .csv file.
Single-response categorical variables
These are MDM categorical variables whose EffectiveMaxValue property is set to 1.
The Delimited Text DSC exports the response to a single-response categorical variable as a single delimited value. By default, the Delimited Text DSC sets the delimited value to the index value of the category in the MDM variable when the response corresponds to that category. That is, the Delimited Text DSC sets the delimited value to 1 if the response corresponds to the first category in the MDM variable, to 2 if the response corresponds to the second category in the MDM variable, and so on. However, you can specify that you want to write different values by using one or more of the methods described in the following table:
To make the Delimited Text DSC write this value
Use this method
The value of the MDM category's Name property.
In the connection string, set the value of the MR Init Category Names custom connection property to 1. Note that this setting will apply to all categorical variables being written.
The value of the MDM category's Value property. That is, the MDM mapped category value.
Use the UseMetaDataValues custom connection property. Note that this setting will apply to all categorical variables being written.
A custom value that you define
In the MDM document used to define the .csv file, set the value of the MDM category's Value property in the Analysis user context.
If more than one of the above methods are used, a higher entry in the table will override a lower one.
Multiple-response categorical variables
These are MDM categorical variables whose EffectiveMaxValue property is greater than 1.
The Delimited Text DSC exports the response to a multiple-response categorical variable as a multiple set of delimited values. The number of values written equals the value of the MDM variable's EffectiveMaxValue property. The first category in the response is written as the first value in the set, the second category in the response is written as the second value in the set, and so on.
The actual delimited value written to the .csv file is as described (and can be customized as described) in "Single-response categorical variables" above. If the response contains less categories than there are delimited values in the set, the Delimited Text DSC writes each unused value as consecutive delimiter characters with nothing in between.
Variables that have codes lists
For an MDM variable of type Long, Double, Text, Boolean, or Date that has a codes list, the Delimited Text DSC exports the codes list as additional delimited values in the .csv file as follows:
If the value of the codes list's EffectiveMaxValue property is 1, the Delimited Text DSC exports the coded response as a single delimited value, as described in "Single-response categorical variables" above.
If the value of the codes list's EffectiveMaxValue property is greater than 1, the SAS DSC exports the coded response as a multiple set of delimited values, as described in "Multiple-response categorical variables" above.
Missing values
For an MDM categorical variable, if the response corresponds to a category that has the flUser flag set (that is, a special category such as Don't Know), the Delimited Text DSC exports the response in the same way as for a non-special category, as described in "Single-response categorical variables" above.
For a non-categorical MDM variable that has a codes list, the Delimited Text DSC exports the MDM variable's response as consecutive delimiter characters with nothing in between if the coded response corresponds to an MDM category (in the codes list) that has the flUser flag set.
See also
Delimited Text DSC