*Convert 1st letter of each Word to Upper Case DATA LIST FIXED /Address 1-25 (a). BEGIN DATA. 248 n. delphia ave. 9273 Fairvew dr. apt 410 6324 Meadowview corner of south & maine END DATA. * Define 5 new string variables to hold the "pieces" of the * address. You may need to define more if you know there are * more separate words in the address. STRING a1 to a5 (a25). * Use the DO REPEAT command to repeat the process for each * "piece" of the address (each separate word, number, etc.). * First find the location of the first space in the address. * Then compute a substring which is the address variable up * until the first space. This is stand-in variable a, which * represents a "piece" of the address. * Then shorten the address variable by making it a substring * of itself from the first space until the end. In other words, * the address variable has the new "piece" trimmed from the * front of it. * Use the CONCAT and UPCASE functions to convert the first * character of the new "piece" you've created to upper case & * concatenate it back together with the remainder of the new * piece (the stand-in variable a). * This sequence loops through 5 times. If you know you'll have * more than 5 "pieces" in the address, define more than 5 * variables, i.e., define strings a1 to a8, instead. DO REPEAT a=a1 to a5. COMPUTE space=index(address," "). COMPUTE a=substr(address,1,space-1). COMPUTE address=substr(address,space+1). COMPUTE a=concat(upcase(substr(a,1,1)),substr(a,2)). END REPEAT PRINT. * Now concatenate the pieces together into the new address * variable. Use the RTRIM function to trim trailing blanks, and * insert single blanks where appropriate. COMPUTE address=concat(rtrim(a1)," ", rtrim(a2)," ",rtrim(a3)," ", rtrim(a4)," ",rtrim(a5)). LIST variables=address.