data work.family;
infile datalines;
input relation $ first_name $ birthdate mmddyy8.;
datalines;
son Frank 01/31/89
daughter June 12-25-87
brother Samuel 01/17/51
;
proc print data = work.family;
*format birthdate mmddyy10.;
run;
The answer tells that the colon must be added. But , I get the perfect output without it , why?
The difference you are seeing is because you did not use the exact datalines. If you look closely you will see that in the second line of the datalines there are spaces in front of the birthdate value. Try including the extra spaces and you will see that the code will not execute properly without the colon.
The spaces in the raw data are significant. Try again with the spacing exactly as stated in the problem.
Thank you for your help.
The difference you are seeing is because you did not use the exact datalines. If you look closely you will see that in the second line of the datalines there are spaces in front of the birthdate value. Try including the extra spaces and you will see that the code will not execute properly without the colon.
Thank you very much.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.