Language SAS Macro Language
(SAS 8.2 Macro Language)
Date: | 04/16/09 |
Author: | Mauro Rospocher |
URL: | n/a |
Comments: | 2 |
Info: | http://v8doc.sas.com/sashtml/macro/index.htm |
Score: | ![]() |
/* SAS Macro Language 8.2 */ /* Recursive SAS Macro solution */ %macro bottiglieSong(bottiglie); %local resto; %let resto=%eval(&bottiglie-1); %put &bottiglie bottles of beer on the wall, &bottiglie bottles of beer.; %put Take one down and pass it around, &resto bottles of beer on the wall.; %put ; %if &bottiglie > 2 %then %bottiglieSong(&resto); %else %do; %put 1 bottle of beer on the wall, 1 bottle of beer.; %put Take one down and pass it around, no more bottles of beer on the wall.; %put ; %put No more bottles of beer on the wall, no more bottles of beer.; %put Go to the store and buy some more, 99 bottles of beer on the wall.; %end; %mend bottiglieSong; /* the macro call */ %bottiglieSong(99)
Download Source | Write Comment
Download Source | Write Comment
Add Comment
Please provide a value for the fields Name,
Comment and Security Code.
This is a gravatar-friendly website.
E-mail addresses will never be shown.
Enter your e-mail address to use your gravatar.
Please don't post large portions of code here! Use the form to submit new examples or updates instead!
Comments