@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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.