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

(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: (2.50 in 4 votes)
*** 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

Alternative Versions

VersionAuthorDateCommentsRate
1Whitey04/20/050

Comments

>>  Kees said on 12/05/08 15:29:45

Kees Nice, nbut you forgot an ampersand:

>>  Sue said on 06/25/10 22:41:16

Sue I agree with Kees. Always remember to debug your beer before use.

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: