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: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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
  • 3 replies
  • 1232 views
  • 2 likes
  • 4 in conversation