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.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.