I'm trying to create a user defined format as follows, but I'm not seing the updated Format in the dataset dis_entity_id. Am I doing something wrong? In my final dataset I want to see the texts as 'Schaden/Unall'
if the ENTITY_ID is 5801
proc format;
Value $ENTIT
'5801'='Schaden/Unall'
'60011'='Hestia'
'56002'='Lebn'
'60041'='Austria'
'6002'='Belgien'
'5401'='Köln'
'54009'='Segros'
'5400'='Belgen'
'test'='NULL';
run;
proc sql;
create table dis_entity_id as select distinct ENTITY_ID format=$ENTIT. from &_INPUT;
quit;
Are there error messages in the log?
Is ENTITY_ID a character variable?
Does PROC CONTENTS show the expected format attached to variable ENTITY_ID?
What do you see in the data set? (SHOW US)
No error Messages in the log.
yes, ENTITY_ID is a character variable
Log says
NOTE: Format $ENTIT has been output.
@Babloo wrote:
No error Messages in the log.
yes, ENTITY_ID is a character variable
Log says
NOTE: Format $ENTIT has been output.
Please provide the answers to all the questions I asked.
@Babloo wrote:
In my final dataset I want to see the texts as
'Schaden/Unall'
if the ENTITY_ID is 5801
And how are you "looking" at your data set dis_entity_id?
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.