Can you execute macro within another macro? If so, how would sas know where the current macro ended and the new one began? : sas-macro



Can you execute macro within another macro? If so, how would sas know where the current macro ended ..

Answer / Shivani Agarwal

Yes, as mentioned in QNO 295047, it is possible to nest macros. To differentiate between the end of one macro and the start of another, SAS uses the semicolon (;) after the outer macro's code before invoking the inner macro.nnFor example:nn %macro outter_macro;n ...n %inner_macro;n ...n %mend outter_macro;nn %macro inner_macro;n ...n %mend inner_macro;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SAS Interview Questions

proc means? proc sort? proc append? proc freq? proc print? proc content?

4 Answers   Oracle,


what are informats in sas? : Sas-administrator

1 Answers  


What is the purpose of _character_ and _numeric_?

1 Answers  


what is the diff. b/w proc means and proc summary?

12 Answers   CitiGroup,


Assuming {et} is randomly drawn from N(0,1) and e0 = 0, generate 200 observations of xt = et − 0.5e(t−1) and draw a line graph of xt.

1 Answers  


how can you create zero observation dataset? : Sas programming

1 Answers  


How would you delete observations with duplicate keys?

6 Answers  


I have a dataset with variables empid and doj how to calculate retirement age?

1 Answers  


code the tables statement for a single level frequency?

2 Answers  


Hi I have list of products in a dataset, which are classified by other name for eg:- there is a product A> Malambo Shiraz Malbec 750ML(0388) which is a Red wine.Now i need to generate a report where it shows if this product appears then it should b displayed as red wine,similarly for other products and other classification. I dont wan use proc format.

4 Answers   Symphony,


what is the difference between proc report and proc format?

7 Answers   CTS,


How do you add a number to a macro variable?

3 Answers  


Categories