We have a large SPSS file, it's 5MB and has about 1400 variables. We are in the process of migrating everything to a database, and in order to configure the tables and forms etc. we need the metadata from the SPSS file, but in a specific custom format.
So if the variable view is like this:
+--------+------------------+---------+-------+----------+----------------+
| Name | Label | Type | Width | Decimals | Values |
+--------+------------------+---------+-------+----------+----------------+
| PATID | Patient Id | Numeric | 8 | 0 | |
| DOB | Date Of Birth | Date | 11 | 0 | |
| SEX | Sex | String | 1 | 0 | {F, Female}... |
| ICFORM | Informed consent | Numeric | 8 | 0 | {0, No}... |
+--------+------------------+---------+-------+----------+----------------+
We need a metadata file in a custom format, something like this:
FieldName;Description;DataType;Width;Decimals;Choices
PATID;"Patient Id";Int;8;0;""
DOB;"Date Of Birth";Datetime;11;0;""
SEX;"Sex";radio;1;0;"F = Female, M = Male"
ICFORM;"Informed consent";radio;8;0;"0 = No, 1 = Yes"
We have a couple of more SPSS files so preferable I would like to do it with a SPSS syntax if possible. In this answer someone suggested using OMS
to capture dictionary
but I have no clue how that would work. When I try this:
DISPLAY dictionary.
OMS dictionary.
I just get an error:
Subcommand OMS. Unknown keyword or subcommand: dictionary.
Execution of this command stops.