BookmarkSubscribeRSS Feed
Siddhartha
Calcite | Level 5

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.

1 REPLY 1
Tom
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.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1422 views
  • 0 likes
  • 2 in conversation