I would like to enter blank values for dates using datalines. I keep getting errors from the program below. What placeholder do I need to enter in line Two for Scott in order to show a null for date?
data want;
length Rank $10 Name $8. Days 8. ;
input Rank $ Name $ Date date9. Days ;
format Date date9. ;
datalines;
One Joe 04Sep2018 30
Two Scott 20
Three Bob 04Sep2018 40
;
run;
do you mean this?
data want;
infile datalines truncover;
length Rank $10 Name $8. Days 8. ;
input Rank $ Name $ Date :date9. Days ;
format Date date9. ;
datalines;
One Joe 04Sep2018 30
Two Scott . 20
Three Bob 04Sep2018 40
;
run;
do you mean this?
data want;
infile datalines truncover;
length Rank $10 Name $8. Days 8. ;
input Rank $ Name $ Date :date9. Days ;
format Date date9. ;
datalines;
One Joe 04Sep2018 30
Two Scott . 20
Three Bob 04Sep2018 40
;
run;
oops, I had missed the colon in front of date9.
Thanks so much 🙂
s seems to read correctly:
data want;
input Rank:$ Name:$ Date:date9. Days ;
length Rank $10. Name $8. Days 8. ;
format Date date9. ;
datalines;
One Joe 04Sep2018 30
Two Scott . 20
Three Bob 04Sep2018 40
;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.