BookmarkSubscribeRSS Feed
Pooja98
Fluorite | Level 6

Hi,
I have data like this

Date
01oct2021
10oct2021
05oct2021
11oct2021
01oct2021
05oct2021
10oct2021

It contain duplicate values.
I need to transpose in row manner. For example,

I want
Date 01oct2021 05oct2021 10oct2021

Thanks

3 REPLIES 3
PeterClemmensen
Tourmaline | Level 20

Usually this is not a good idea, but here you are

 

data have;
input Date :date9.;
format Date date9.;
datalines;
01oct2021
10oct2021
05oct2021
11oct2021
01oct2021
05oct2021
10oct2021
;

proc sort data = have nodupkey;
   by Date;
run;

proc transpose data = have out = want prefix = d;
   var Date;
run;
PaigeMiller
Diamond | Level 26

So, @Pooja98 as you can see from the reply by @PeterClemmensen this is easy to do.

 

However, usually its not a good thing to do because it makes the next steps (the analysis, or the report) more difficult. Would you be kind enough to tell us what the next steps (analysis or report) will be? 

--
Paige Miller
Reeza
Super User
I'd recommend adding an IDLABEL option here and have the label be the date.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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
  • 3 replies
  • 1088 views
  • 2 likes
  • 4 in conversation