proc print data=sashelp.cars (obs=1);
title "Report for &sysdate";
run;
No idea how to fix this....
| Report for 13FEB20 |
| Obs | Make | Model | Type | Origin | DriveTrain | MSRP | Invoice | EngineSize | Cylinders | Horsepower | MPG_City | MPG_Highway | Weight | Wheelbase | Length |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Acura | MDX | SUV | Asia | All | $36,945 | $33,337 | 3.5 | 6 | 265 | 17 | 23 | 4451 | 106 | 189 |
Can you use today(), since SYSDATE contains the date on which a SAS job or session began executing which likely means you didn't start your session today. So TODAY() function is a good bet
proc print data=sashelp.cars (obs=1);
title "Report for %sysfunc(today(),date9.)";
run;
| Report for 14FEB2020 |
| Obs | Make | Model | Type | Origin | DriveTrain | MSRP | Invoice | EngineSize | Cylinders | Horsepower | MPG_City | MPG_Highway | Weight | Wheelbase | Length |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Acura | MDX | SUV | Asia | All | $36,945 | $33,337 | 3.5 | 6 | 265 | 17 | 23 | 4451 | 106 | 189 |
Can you use today(), since SYSDATE contains the date on which a SAS job or session began executing which likely means you didn't start your session today. So TODAY() function is a good bet
proc print data=sashelp.cars (obs=1);
title "Report for %sysfunc(today(),date9.)";
run;
| Report for 14FEB2020 |
| Obs | Make | Model | Type | Origin | DriveTrain | MSRP | Invoice | EngineSize | Cylinders | Horsepower | MPG_City | MPG_Highway | Weight | Wheelbase | Length |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | Acura | MDX | SUV | Asia | All | $36,945 | $33,337 | 3.5 | 6 | 265 | 17 | 23 | 4451 | 106 | 189 |
You should see what &SYSDATE does on April Fool's Day.
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 save with the early bird rate—just $795!
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.