@novinosrin I think this is what you need.
data have;
input Year Name_ID Type $ Price Pieces;
datalines;
2017 1 Aa 100 .
2017 1 Bb 200 3
2016 2 Cc 80 4
2017 2 Cc 500 2
2018 1 Aa 30 11
2018 1 Bb 40 32
2018 2 Aa 50 5
2018 2 Cc 10 6
;
run;
proc sort data=have;
by name_id type year;
run;
proc print;
run;
proc summary data=have nway missing completetypes;
class type year;
output out=_have;
run;
data _have;
set _have have;
run;
proc transpose data=_have out=temp;
by name_id type year;
var price pieces;
run;
proc transpose data=temp out=want(drop=_: where=(not missing(name_id))) delimiter=_;
by name_id type;
id _name_ year;
run;
proc print;
run;
@novinosrin and @data_null__ Wow, thanks for your help guys! Very nice way.
@Emjay If I would pay somebody to read their content, Guru is right up there. Let me also add my thanks to yours.
@data_null__ Guru thankkkkkkkkkkkkkkkkkkkkkkkk youuuuuuuuuuuuuuuuuuuuuuuuuuuu!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! as always
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.
Ready to level-up your skills? Choose your own adventure.