I am working with a dataset that contains more than 100 different categorical variables, some with up to 10 possible categories. The data manager provides separate .DAT files with labels for each category, using the following structure:
data format;
input label $ formatname $ type $ code;
datalines;
Not reported RESULT N 999
Positive RESULT N 1
Negative RESULT N 2
Missing RESULT N .
Small SIZE N 1
Medium SIZE N 2
Large SIZE N 3
Missing SIZE N .
...
I'm able to import these .DAT files to create a format datasets as follows:
PROC IMPORT OUT= formats (RENAME=(VAR1=LABEL VAR2=FMTNAME VAR3=TYPE VAR4=CODE))
DATAFILE="C:\\..."
DBMS=TAB REPLACE;
GETNAMES=no;
DATAROW=1;
RUN;
Is there a way to apply all labels in this formats dataset to the dataset I'm using for the project, without manually writing each entry using proc format?