DATA Step, Macro, Functions and more

Creating specific output using two datasets in sas

Reply
Contributor
Posts: 69

Creating specific output using two datasets in sas

Hi,

I have a two data set named dataset1 and dataset2 and want to create output like the one in attached excel workbook Test sheet name output

Both the dataset are in same format as in excel sheet attached.

Could anyone help me with SAS code or macro to create dataset as the one in output sheet

All the variable except central are created using dataset1 and counting region for example

proc sql;
create table NEW AS
SELECT region,COUNT(region)AS _61OMP from perf.input
WHERE region="Kundelinjen (Ledelse & stab)"
and fejltype="3829 RD BACO" and fejltekst="Sag sendt for sent ind"

GROUP BY REGION, fejltype,fejltekst  ;
QUit;

output files has all the conditions in form of excel formula.

and  Central variable is created using sum function and dataset2

regards.

Super User
Super User
Posts: 6,502

Creating specific output using two datasets in sas

You will need to provide more words to descibe what you want to happen.

It looks from a quick inspection that you want to use PROC FREQ or some other summary method to generate the counts in your "output" sheet. 

How do the two other sheets interact?  From quick inspection it looks like the first are the events to count and the second is perhaps the denominator counts by region?  If you need to link them how are the linked?  The first sheet seems to have region name and the second has what looks like a region id number.

Ask a Question
Discussion stats
  • 1 reply
  • 182 views
  • 0 likes
  • 2 in conversation