BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Kurt_Bremser
Super User

Apart from Maxim 46 (Beware of the Hidden Blanks), you should also heed Maxim 11 (A Macro Is Not Needed) and, for the time being, forget that macros exist. You can and should then relearn this when you have mastered the basics of the SAS language, like DO loops in a data step:

data have;
infile datalines truncover;
input topics $256.;
datalines;
PHYSICAL COMPUTING  BASIC COMPUTER TEACHING  PROJECTS USING WORD PROCESSING AND DATA ANALYZING  POWERPOINT
GAME DESIGN
WEB DESIGN AND DEVELOPMENT MOBILE APP DEVELOPMENT
PHYSICAL COMPUTING MAKER ACTIVITIES WEB DESIGN AND DEVELOPMENT TEXT-BASED PROGRAMMING
;

data want;
set have;
array keywords [6] $ t1-t6 ('PHYSICAL','ACTIVITIES','GAME','DATA','CODING','MOBILE');
array varnames [6] physcomp makeract gamedesign datasci coding mobiledev; 
do _n_ = 1 to 6 ;
  if findw(topics, trim(keywords[_n_])) > 0 then varnames[_n_] = 1;
  else varnames[_n_] = 0;
end; 
run;

To become master of a tool, the most important thing to learn is when not to use it.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 15 replies
  • 2360 views
  • 12 likes
  • 7 in conversation