Can someone help me read the DATE variable as a DATE7. format? I failed so I am just reading it as character format. The code is below. I am using SAS University Edition. Thanks.
data sasuser.amounts;
input Name $1-12 EmpID 14-18 Date $20-26 Amt 28-29;
datalines;
ANKERTON, L. 11123 08OCT16 92
ANKERTON, L. 11123 15OCT16 43
DAVIS, R. 22298 04OCT16 16
MASTERS, T. 33351 13OCT16 18
MASTERS, T. 33351 27
THOMAS, A. 21OCT16 15
WOLMER, B. 44483
;
Assuming that the date always appears in columns 20-26:
input ..... @20 date date7. ...........;
You would probably want to add a FORMAT statement to print DATE in the format of your choice when displaying the data.
Assuming that the date always appears in columns 20-26:
input ..... @20 date date7. ...........;
You would probably want to add a FORMAT statement to print DATE in the format of your choice when displaying the data.
Awesome! Thank you!
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!
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.