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-2024.png

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