Developer Documentation Library > Data Model > UNICOM Intelligence Data Model accessories > Metadata Model to Quantum > Defining card, column, and punch code specifications > Allocating card, column, and punch Codes manually
 
Allocating card, column, and punch Codes manually
You allocate card, column, and punch codes to a variable manually by double-clicking the variable in the Metadata Model to Quantum window. For categorical variables, the dialog contains a grid that lists the elements and shows the punch codes that have been allocated to them. If you use the scroll bar, you will see there are also Error Flag and Element Name columns. If an error has been detected for the element, the error code will be shown in the Error Flag column.
If the variable shares a category list with any other variables (for example, because the variable is part of a loop or a grid or uses a defined list), changing the punch and column offset details for a category in this dialog changes the punch and column offset details on the category in those other variables too. However, Metadata Model to Quantum warns you when you close this dialog and give you an option to cancel the operation.
Starting column
Generally this is the combined card and column number of the first column that is to store the responses in the variable. However, if you are using one card of unlimited length, this is the column number.
You can enter the column count only and leave the starting column blank. This means that when you next run Allocate Cols and Punches (provided you do not select the overwrite option), Metadata Model to Quantum allocates the specified number of columns to this variable at the next available position.
Column count
The number of columns that are required to store the responses.
Data format
The list provides support for additional data formats that can be used with categorical questions:
Punch: This option works the same for both multiple-response and single-response categoricals. When selected, additional data formats are not currently used.
Numeric: This option is available for both multiple-response and single-response categoricals (works similarly to a single-response categorical). When working with multiple-response categoricals, the Column count must include enough columns for each response to be written. For example, if the Code width is 2 and the maximum number of values that can be chosen for the question is 6, then the Column count must be at least 12. When selected, only numeric values are allowed in the Value field, and both the Column count and Code width options must be defined. By default, numeric data formats are blank filled but they can be zero filled.
Literal: This option is only available for single-response categoricals. When selected, both alphabetic and numeric characters are allowed in the Value field, and both the Column count and Code width options must be defined. By default, literal data formats are blank filled but they can be zero filled.
Metadata Model to Quantum will never update the value in the Analysis context.
Bitstring: This option is only available for multiple-response categoricals. and works similarly to the explode multi punch option for a multiple-response numeric. When selected, both alphabetic and numeric characters are allowed in the Value column, and both the Column count and Code width options must be defined.
Code width
This option is only available when the Data Format is set to either Numeric or literal, and defines the maximum Value code width.
Zero fill on the left
This option is only available when the Data Format is set to Numeric. Selecting this option causes zero (0) characters to be added to the left of the Value up to the length of the Code Width. If this option is not selected, blanks are used instead of zeros.
Category
Defines the punch code and column offset for the category. To change the values, you need to select the category in the grid below. Click Refresh when you have entered the new values to update the value in the grid.
Punch. Defines the punch code for the category. This should conform to one of the codes defined in the punch mask. For more information, see Card and Column preferences.
Col Offset. Defines the column in which the punch for the category is stored. It is in the form of a number that is added to the variable's starting column.
You can increase the column offset for more than one element at once, by right-clicking and choosing the Increment column offset command. This prompts you for a value to add to the column offset for each of the selected elements. Enter a negative number if you want to reduce the column offset. When you click OK, Metadata Model to Quantum updates the elements accordingly.
Value - This option is available when Numeric or Literal are selected as a Data Format, and allows you to define or change the value for the selected label. If the question has a value in the CardCol context, then it is displayed in the Value column. If there is no value in the CardCol context, but there is an analysis value (typically setup while writing the original interview script), then the analysis value is displayed. If an analysis value exists, a CardCol context value is not assigned during allocation. If you select to change the displayed value (whether it is an Analysis or CardCol context value), the update is written to the value in the CardCol context.
Error Flag
If an error has been detected for this element, this column displays a code representing the first error encountered. However, Metadata Model to Quantum checks the definitions only when you run Check Cols and Punches (see Checking the card, column, and punch definitions), Export Quantum Specification, and Export Data Map (see Using the Data Map) commands. This means that Metadata Model to Quantum does not display an error if you have manually allocated any invalid punch definitions since you last ran one of these commands. For more information, see Metadata Model to Quantum error codes.
If the variable has a major column allocation error (such as C5 or C6), Check Cols and Punches does not perform any punch code checks. This means that if no punch error codes are shown for a variable that has a column allocation error, you need to correct the column allocation problem and run Check Cols and Punches again to be sure there are no punch errors for this variable.
Element name
The element's name.
Export Quantum axis
Select this check box if you want Metadata Model to Quantum to include this variable in the Quantum specification. Deselect this check box if you want Metadata Model to Quantum to exclude this variable from the Quantum specification. However, all variables require card, column, and punch codes regardless of whether they are selected for inclusion in the Quantum specification.
Metadata Model to Quantum does not check the punch codes when you allocate them or when you close this dialog. However, you can run the check manually at any time. For more information, see Checking the card, column, and punch definitions.
To allocate card, column, and punch codes manually
1 In the Metadata Model to Quantum window, do one of the following:
Double-click the variable for which you want to allocate card, column, and punch codes.
Right‑click the variable, and then click Edit question.
2 In the Starting Column text box, enter the combined card and column number of the first column that is to store the responses to the question.
3 In the Column Count text box, enter the number of columns that are required for the variable.
4 To allocate punch codes to a category, select it in the grid and enter the Punch and Col Offset. Click Refresh to update the category's punch details in the grid below. Repeat this step for each category.
5 Click OK.
See also
Allocate Cols and Punches
Allocating card, column, and punch Codes manually
Defining card, column, and punch code specifications