What is the syntax for printing a variable in a SAS program? I know how to do this in a stored process but looking for the syntax for a program.
data enrollment; set enrollment;
length yearToNull $4.;
if(substr(max_academic_period, 5, 2) ne '30') then do;
yearToNull = substr(max_academic_period, 1, 4);
/*put yearToNull;*/
if(substr(academic_period, 1,4) = yeartoNull) then Annual_FTE = 0;
end;
run;
What you have done, the "put yeartonull;" should work?
data _null_; set sashelp.cars; put make; run;
Do you want to print it to the log or to the Results Viewer?
I'm trying to see it in the log.
What you have done, the "put yeartonull;" should work?
data _null_; set sashelp.cars; put make; run;
Thank RW9, apparently I was running into another condition that was making my put statement not show up, and thought I had the syntax for the basic put statement wrong.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.