It would help if you more clearly explained your problem. I go by the assumption that you do not have a unique id and want a way to make one.
"If" manufacturer and model together are unqiue, this would be one way:
Data a_sales ;
set _class_s.a_sales;
keep Unique_id Manufacturer Model ;
Unique_id = md5(cats(Manufacturer, Model));
run;
proc print data=a_sales;
run;
Data a_sales ;
set _class_1.a_sales;
drop Manufacturer Model ;
Data a_sales ;
set _class_s.a_sales;
keep Manufacturer Model ;
run;
proc print data=a_sales;
run;
Data a_sales ;
set _class_1.a_sales;
drop Manufacturer Model ;
Unique_id = md5(cats(Manufacturer, Model));
run;
proc print data=a_sales;
run;
run;
proc print data=a_sales;
run;
MD5() or it's more modern sibling SHA256() make a hash of it's character argument in a reproducable way. Another approach would take the row number but that can change and is not my preference. But it's up to you.
Hope this helps,
- Jan.