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.
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.