I’m having trouble with merging two datasets. I’m using SAS 9.2 and when importing several datasets they get corrupted and I can only open the last imported set.
DATA my_set1;
SET my_library.my_set1;
OPTIONS FMTSEARCH = (my_library.labels_my_set1);
RUN;
DATA my_set2;
SET my_library.my_set2;
OPTIONS FMTSEARCH = (my_library.labels_my_set2);
RUN;
The labels are set like this:
DATA labels;
SET formatted;
LABEL var_1 = 'label1'
var_2 = 'label2';
RUN;
DATA labels2;
SET labels;
PROC FORMAT LIBRARY = my_library.my_set1;
VALUE missing_num_labels . = 'Missing';
VALUE $missing_char_labels ' ' = 'Missing';
VALUE yes_no_labels 0 = 'No'
1 = 'Yes'
. = 'Missing';
RUN;
DATA labels2;
SET labels2;
OPTIONS FMTSEARCH = (my_library.my_set1);
FORMAT var_1 yes_no_labels.;
RUN;
I then do the exact same but for my_library.my_set2 instead of my_library.my_set1.
Thanks!
Here’s my solution that worked, as @CarolinaJay65 suggested the OPTIONS is not specific for the dataset.