I am working on a project and the part I need help on requires:
Data set EMPLOY contains:
ID (employee number),
GENDER, and
DOB (date of birth).
Data set PARTS contains:
PART_NO and
PRICE.
Data set SALES contains:
ID (employee number),
TRANS (transaction number),
PART_NO, and
QUANTITY (for each sales call completed).
Write a SAS program to read the data sets and
I have managed to multiply quantity with price in order to get total sales but I am missing a few values so I know I didn't sort it the right way. I am at a dead end at this point and will appreciate the help.
Here's my code thus far:
libname datain 'F:\SAS2018\Data';
/***********************************************************************/
data employ_ds;
set datain.employ;
run;
proc print data=employ_ds;
format ID z2. Bday MMDDYY8.;
run;
/***********************************************************************/
data parts_ds;
set datain.parts;
run;
proc print data=parts_ds;
format price dollar6.2;
run;
/***********************************************************************/
data sales_ds;
set datain.sales;
run;
proc print data=sales_ds;
run;
/***********************************************************************/
data transaction_sales;
merge datain.sales datain.parts;
total= quantity*price;
run;
proc sort data=transcation_sales;
by ID;
run;
proc print data=transaction_sales;
format ID z2. ;
run;
/***************************************************************************************/
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.