here is the transpose you are requesting:
data have;
input Cp_ID $
ID $
CONTENT $
ITEMCOUNT
LAST :date9. MODIFY $;
cards;
Cpid123. A2. One. 1864 20sep2018 17:54:02
Cpid123. A2. Two 20 20sep2018 17:36:09
Cpid123. A2. Five. 543 20sep2018 17:59:04
Cpid123. A2. Ten. 67 20sep2018 17:38:16
Cpid123. A2. One. 500 19sep2018 16:33:08
Cpid123. A2. Two 200 19sep2018 17:49:12
;
proc sort data=have;
by cp_id id last modify;
run;
proc transpose data=have out=want(drop=_name_);
by cp_id id last modify;
id content;
var itemcount;
format last date9.;
run;
proc print data=want;run;
a link to how to transpose data.
https://stats.idre.ucla.edu/sas/modules/how-to-reshape-data-long-to-wide-using-proc-transpose/
You can use the methods here to provide sample data in a format that others can easily use:
here is the transpose you are requesting:
data have;
input Cp_ID $
ID $
CONTENT $
ITEMCOUNT
LAST :date9. MODIFY $;
cards;
Cpid123. A2. One. 1864 20sep2018 17:54:02
Cpid123. A2. Two 20 20sep2018 17:36:09
Cpid123. A2. Five. 543 20sep2018 17:59:04
Cpid123. A2. Ten. 67 20sep2018 17:38:16
Cpid123. A2. One. 500 19sep2018 16:33:08
Cpid123. A2. Two 200 19sep2018 17:49:12
;
proc sort data=have;
by cp_id id last modify;
run;
proc transpose data=have out=want(drop=_name_);
by cp_id id last modify;
id content;
var itemcount;
format last date9.;
run;
proc print data=want;run;
Then make fake data or use a dataset from SASHELP.CLASS.
@Gil_ wrote:
Reeza i cant copy and post my actual code restrictions
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!
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.