BookmarkSubscribeRSS Feed
SASUser0001
Fluorite | Level 6

hi I have marco that is creating proc summary statement . I wanted to scale in output  everything by a number like 2 or 3 . like in below program I want to multiply outdata with a number like 2 or 3 based on I will create a macro on top with %let statement . can anyone help please .

output out= outdata (drop=_type_ _freq_) sum=;

 

run;

 

4 REPLIES 4
ballardw
Super User

You use a data step on the  output data from your proc summary.

 

data want;

   set outdata;

   <calculations go here>

;

SASUser0001
Fluorite | Level 6

hi this is my programe where should I use

 

macro d1(name, list)

proc summary data=total nway missing

 

var &list

output out= data1 (drop=_type_ _freq_) sum=

 

run

mend d1

 

 

Kurt_Bremser
Super User
  1. Post complete working non-macro code of the step you want to repeat. Your code as posted is syntactically invalid.
  2. Post a second example for the second iteration, so we can see what needs to change.
  3. Tell us over which range the iterations need to run.
  4. Use the "little running man" icon to post the code examples.
PaigeMiller
Diamond | Level 26

@SASUser0001 wrote:

hi this is my programe where should I use

 

macro d1(name, list)

proc summary data=total nway missing

 

var &list

output out= data1 (drop=_type_ _freq_) sum=

 

run

mend d1

 

 


Please help us all out and don't post code that doesn't have semi-colons and doesn't have % signs on the macro commands and has other obvious syntax errors. Please use the "running man" icon and post your code in the window that appears.

 

Also, @ballardw has already explained that you need to do the multiplication in a data step after your PROC SUMMARY, and he has given example code. Give that a try.

--
Paige Miller

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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