Hello I am attempting to apply a new format to my data, but whenever I try and use the format, I get "Unexpected Value" in the output. However, when I change the format name by even one letter - adding one, deleting one, or changing one in the middle - I get the results I am looking for. This is a project for a class which requires a specific format name ($StateCd), otherwise I would accept the results as they are and not be as picky. I thought maybe the fact that it is the same name as the renamed variable, but even when I do not rename the variable, the format still does not work. If anyone has any input on why and how to fix it, I would really appreciate it! Code: PROC FORMAT;
VALUE $StateCd
' ' = 'Unknown'
'Ohio' = 'OH'
'Delaware' = 'DE'
'Alaska' = 'AS'
OTHER = 'Unexpected Value';
RUN;
DATA WORK.Contact_Ohio;
SET HypImpt.OhioResidents (RENAME= (Initials= Inits
State=StateCd)
);
KEEP SSN Inits City StateCd ZipCd;
Inits = CATS( SUBSTR(Inits, 1, 1),
SUBSTR(Inits, 3, 1),
SUBSTR(Inits, 4, 1)
);
RUN;
PROC PRINT DATA = WORK.Contact_OH;
FORMAT StateCd $StateCd.;
RUN;
There are no errors or warnings in the log. Thanks in advance
... View more