BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Gil_
Quartz | Level 8
I have a data pull that looks

Date. Id. Issue
01/01/16. A1. Code A
01/02/16. B3. Code A
01/03/16. D2. Code D.
01/05/16. W3. Code T

I'm looking for telling proc transpose look like this

Code A. Code D Code T
O1/01/16. A1. 1
01/02/16. B3. 1
01/03/16. D2. 1
01/05/16. W3. 1
1 ACCEPTED SOLUTION

Accepted Solutions
PGStats
Opal | Level 21

Proc tabulate or proc report will create this kind of report table :

 

data have;
input Date :ddmmyy. Id $ Issue $&;
format date yymmdd10.;
datalines;
01/01/16 A1 Code A
01/02/16 B3 Code A
01/03/16 D2 Code D
01/05/16 W3 Code T
;

proc tabulate data=have format=7.0;
class date id issue;
table date*id,Issue=""*n="";
run;

PG

View solution in original post

4 REPLIES 4
Gil_
Quartz | Level 8
Sorry it didn't save like i wanted to show i need issue to be on top like a pivot table with the count of occurrence. With id and date on left side going up and down ...
Reeza
Super User

@Gil_ wrote:
Sorry it didn't save like i wanted to show i need issue to be on top like a pivot table with the count of occurrence. With id and date on left side going up and down ...

Yeah, I'm not seeing what you want. 

 

If you want a pivot table type report look at proc tabulate. If you want a dataset with indicators (?) look at creating indicator variables.

http://blogs.sas.com/content/iml/2016/02/22/create-dummy-variables-in-sas.html

PGStats
Opal | Level 21

Proc tabulate or proc report will create this kind of report table :

 

data have;
input Date :ddmmyy. Id $ Issue $&;
format date yymmdd10.;
datalines;
01/01/16 A1 Code A
01/02/16 B3 Code A
01/03/16 D2 Code D
01/05/16 W3 Code T
;

proc tabulate data=have format=7.0;
class date id issue;
table date*id,Issue=""*n="";
run;

PG
Gil_
Quartz | Level 8
Thanks PGStats

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 4 replies
  • 2602 views
  • 1 like
  • 3 in conversation