The SAS Output Delivery System and reporting techniques

macros %if %then %else

Reply
N/A
Posts: 0

macros %if %then %else

here data
data one;
input id sale amt;
cards;
101 150 4500
102 200 5500
103 210 6000
;
condition sale >=200
by using macros
i want output with code

regards
satya
Frequent Contributor
Posts: 95

Re: macros %if %then %else

I don't see the reason to use a macro. Why not just use one of these (it's not clear from your post whether you want a new dataset, a printout, or some other result)?

proc print data=one noobs;
where sale >= 200;
run;

or

data two;
set data one;
where sale >= 200;
run;

or

data one;
input id sale amt;
if sale >= 200 then output;
cards;
101 150 4500
102 200 5500
103 210 6000
;
Ask a Question
Discussion stats
  • 1 reply
  • 105 views
  • 0 likes
  • 2 in conversation