PROC FORMAT; VALUE verse 1 = '1st' 2 = '2nd' 3 = '3rd' 4 = '4th' 5 = '5th' 6 = '6th' 7 = '7th' 8 = '8th' 9 = '9th' 10 = '10th' 11 = '11th' 12 = '12th'; VALUE gift 1 = 'A partridge in a pear tree!' 2 = 'Two turtle doves, and' 3 = 'Three french hens,' 4 = 'Four calling birds' 5 = 'Five gold rings....' 6 = 'Six geese a-laying' 7 = 'Seven swans a-swimming' 8 = 'Eight maids a-milking' 9 = 'Nine ponies prancing' 10 = 'Ten lords a-leaping' 11 = 'Eleven pipers piping' 12 = 'Twelve drummers drumming'; RUN; /* print output to the log */ DATA _NULL_; LENGTH var $53; DO verse = 1 TO 12; var = 'On the '||TRIM(LEFT(PUT(verse, verse.)))||' day of Christmas my true love gave to me:'; PUT var; PUT; DO count = verse TO 1 BY -1; PUT count gift.; END; PUT; PUT; PUT; PUT; END; RUN; %*------------------------------------* | MERRY CHRISTMAS AND HAPPY NEW YEAR | *------------------------------------*;