BookmarkSubscribeRSS Feed
MarkWik
Quartz | Level 8


Hi,

I have 36 different datasets and I am in need to

1.  compute the entire descriptives such as mean, min,max, standard deviation etc like proc means for all numeric variables in each dataset and do a  Boxplot?

2. Count/ establish frequency for all character variables  in each dataset?

3. Route the output to a ODS pdf file format report.

what is the best solution/proc.I seek an expert help in establishing an optimised way to compute without having to write a 36 proc steps, which is rather tedius considering what if i have 100 tables in future. How to loop and macrotise it? An example with a code would be of great help.

Regards,

Mark

3 REPLIES 3
Reeza
Super User

Do you have the code for one iteration? Do you have a naming convention for your datasets, how do you identify which need to be summarized?

You can search at lexjansen.com for macros that summarize data.

Cynthia_sas
Diamond | Level 26

Hi:

  Reeza is correct. Before you "macrotise" a program, you have to have at least 1 working program as a model of the code you want to generate. So the place to start, when you want to "macrotise" a process so it is repeatable is with a working SAS program.

  These papers might help you get started using SAS macro variables and writing simple SAS Macro programs:

https://support.sas.com/resources/papers/proceedings13/120-2013.pdf

and

http://www2.sas.com/proceedings/sugi28/056-28.pdf

cynthia

Ksharp
Super User

make a macro contains proc means to get what you need ,then use call execute to go through all of these 36 tables.

CFC_SAS_Communities_400x225.jpgCFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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
  • 3 replies
  • 1810 views
  • 0 likes
  • 4 in conversation