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.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Early bird rate extended! Save $200 when you sign up by March 31.
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.
Ready to level-up your skills? Choose your own adventure.