New SAS User

Completely new to SAS or trying something new with SAS? Post here for help getting started.
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
NewUsrStat
Lapis Lazuli | Level 10

Hi guys, 

suppose to have the following:

 

data have;
input Id response $ qualification $;
cards;
1 temperature Professor
1 disfunction Professor
1 comorbidities Professor
2 comorbidities Psichol
2 flu Psichol
33 temperature Doctor
44 behavior Psy
44 temperature Psy
44 flu Psy
5 flu oss
5 temperature oss
5 disfunction oss
5 behavior oss
;;;;
run;

 

Is there a way to format the table in this way? 

Desired table: 

Id temperature disfunction comorbidities flu behavior
1 Professor Professor Professor not_selected not_selected
2 not_selected not_selected Psicholog Psicholog not_selected
33 Doctor not_selected not_selected not_selected not_selected
44 psy not_selected not_selected psy psy
5 oss oss not_selected oss oss

 

Thank you in advance

1 ACCEPTED SOLUTION

Accepted Solutions
1 REPLY 1
Kurt_Bremser
Super User
proc report data=have;
column id response,qualification n;
define id / group;
define response / "" across;
define qualification / "" display;
define n / "" noprint;
run;

sas-innovate-white.png

Join us for our biggest event of the year!

Four days of inspiring keynotes, product reveals, hands-on learning opportunities, deep-dive demos, and peer-led breakouts. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 663 views
  • 1 like
  • 2 in conversation