It's nearly July 17, also known as #WorldEmojiDay! In this challenge, the famous CLASS data set received an update for the modern times we live in. We still have student names, but all other attributes have been replaced with emojis. We've now got fields for gender (we don't use the term "sex" anymore), current mood, "spirit" animal, and appointment time.
You'll find the new data set attached as a CSV file (modern_class.csv) to this message. Your job is to read the new class data into SAS and "translate" the emoji fields into words (presumably so that people who don't "speak emoji" can read it). Create a SAS report (PROC PRINT is fine) that contains the "wordy" version of the data. Show your code and results in your replies.
Hints/Notes:
(Note: last year we shared this challenge on SAS Analytics Explorers. Decided to share with a wider audience this time!)
The clocks made that interesting.
data appt_time;
fmtname='$appt_time';
do i=128336 to 128347;
start=unicode(cats('&#',i,';'),'ncr');
label=put(mod(i,128335)*3600,hhmm.);
output;
end;
do i=128348 to 128359;
start=unicode(cats('&#',i,';'),'ncr');
label=put(mod(i,128347)*3600+1800,hhmm.);
output;
end;
run;
proc format lib=work cntlin=work.appt_time;
run;
proc format;
value $gender
👦='Male'
👧='Female'
🧒='Non-Binary'
other='Undefined'
;
/* and so on for the rest */
run;
data modern_class;
infile datalines dlm=',' dsd truncover;
input (name gender mood animal appt_time) ($);
datalines;
Alfred,👦,😏,🦄,🕛
Alice,👧,😒,🦓,🕧
Barbara,👧,🙄,🦌,🕐
Carol,🧒,😬,🦬,🕜
Henry,👦,🤥,🐮,🕑
James,👦,😌,🐂,🕝
Jane,👧,😔,🐃,🕒
Janet,🧒,😪,🐄,🕞
Jeffrey,👦,🤤,🐷,🕓
John,👦,😴,🐖,🕟
Joyce,👧,😒,🐗,🕔
Judy,🧒,🙄,🐽,🕠
Louise,👧,😬,🐏,🕕
Mary,👧,😌,🐑,🕡
Philip,👦,😔,🐐,🕖
Robert,🧒,😪,🐪,🕢
Ronald,👦,😏,🐫,🕗
Thomas,👦,😒,🦙,🕣
William,👦,🙄,🦒,🕘
;
proc print data=modern_class;
format gender $gender. appt_time $appt_time.;
run;
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.