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?
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.