List<Field> categoricalFields = new ArrayList<Field>();
// write variable definitions
for (Field field : columns)
{
FieldType fieldType = field.getType();
if (fieldType.getEnumType() == FieldTypeEnum.CATEGORICAL)
{
categoricalFields.add(field);
}
colNames.write(String.format("%s %s ", field.getName(), colTypeToSPSSType(fieldType.getEnumType())));
}
// add category labels to variables if appropriate
for (Field field : categoricalFields)
{