Hi everyone,
I am trying to complete the problem below, but am having a lot of trouble with it.
The data set is: DATA address;
INPUT #1 @1 line1 $50.
#2 @1 line2 $50.
#3 @1 line3 $50.;
DATALINES;
Mr. Jason Simmons
123 Sesame Street
Madison, WI
Dr. Justin Case
78 River Road
Flemington, NJ
Ms. Marilyn Crow
777 Jewell Avenue
Pittsburgh, PA
;
RUN;
Use the following program: ( homework_problem1.sas ) to create the data set address. Then, use the line1, line2, and line3 variables to create three new variables:
- name: containing just the first and last name separated by one blank space, and then the whole name surrounded by a colon on the left and a colon to the right
- street: containing the house number, street, and type of road, with separations of only one blank space, and Road replaced by Rd., Street replaced by St., and Avenue replaced by Ave., and the whole thing surrounded by a colon on the left and a colon to the right
- city: containing the town and state with a separation of a comma and one blank space surrounded by a colon on the left and a colon to the right
When all is said and done, print out your the three variables so that it looks like this:

Use the compbl, scan, catx and || functions to create name. Use tranwrd, trim, compbl and || to create street. And use trim, compbl and || to create city.