Voting

Category

real language

Bookmarking

Del.icio.us Digg Diigo DZone Earthlink Google Kick.ie
Windows Live LookLater Ma.gnolia Reddit Rojo StumbleUpon Technorati

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: (3.02 in 91 votes)
/* 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

Alternative Versions

Comments

>>  MARCELLA28Lawrence said on 08/14/10 13:28:56

MARCELLA28Lawrence That is understandable that money can make people autonomous. But what to do when somebody does not have money? The one way is to try to get the <a href="http://bestfinance-blog.com/topics/home-loans">home loans</a> and just short term loan.

>>  Konsolen said on 09/01/10 06:05:36

Konsolen

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!

Name:

eMail:

URL:

Security Code:
  
Comment: