Language SAS
(Produces words rather than digits.)
| Date: | 01/04/06 |
| Author: | Alan D Rudland |
| URL: | http://www.netdominus.co.uk |
| Comments: | 2 |
| Info: | http://www.sas.com |
| Score: |
*** Alan D Rudland - NetDominus 04/01/06 *** :
data _null_ ;
%let bot = bottle of beer ;
%let bots = bottles of beer ;
%let wall = on the wall ;
do i = 99 to 1 by -1 ;
format i j words13. ;
j = i - 1 ;
i_word = upcase(substr(put(i,words13.),1,1)) !!
substr(put(i,words13.),2) ;
if i = 1 then
put i_word "&bot &wall, " i "&bot.." ;
else
put i_word "&bots &wall, " i "bots.." ;
put 'Take one down, pass it around, ' @ ;
if j>= 2 then
put j "&bots &wall.." ;
else if j = 1 then
put j "&bot &wall.." ;
else if j = 0 then
do ;
put "no more &bots &wall.." ;
put ;
put "No more &bots &wall.. " @ ;
put "no more &bots.." ;
put 'Go to the store, buy some more...' @ ;
*** Uncommenting the lines below will create a continuous loop *** ;
*** i = 99 ;
*** put i "&bots &wall.." ;
end ;
put ;
end ;
run ;
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