BookmarkSubscribeRSS Feed
Calcite | Level 5


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  ;

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

and  Central variable is created using sum function and dataset2


Super User Tom
Super User

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.


Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.


Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 2 in conversation