Hello,
I'm looking to update my NEWSURV macro with the ability to grab RMST values from proc LIFETEST, and I was curious if there is a system macro variable to grab the session's SAS/STAT version like there is for the actual SAS version. I'm not sure if SAS/STAT is automatically updated for SAS 9.4M5 or if they are updated separately on user's systems. I believe the RMST options were added in SAS/STAT 15.1 so I'm looking for a macro variable to tell me which version number the user was on.
Hello @JeffMeyers,
I'm not sure if there's an easier way, but in any case you could read that version number from PROC PRODUCT_STATUS output.
Example:
proc printto log=work._tmpcat._tmp.log;
proc product_status;
proc printto;
run;
filename tmplog catalog 'work._tmpcat._tmp.log';
data _null_;
infile tmplog;
do until(_infile_=:'For SAS/STAT');
input;
end;
input @'Custom version information:' statver;
call symputx('statver',statver);
run;
Hello @JeffMeyers,
I'm not sure if there's an easier way, but in any case you could read that version number from PROC PRODUCT_STATUS output.
Example:
proc printto log=work._tmpcat._tmp.log;
proc product_status;
proc printto;
run;
filename tmplog catalog 'work._tmpcat._tmp.log';
data _null_;
infile tmplog;
do until(_infile_=:'For SAS/STAT');
input;
end;
input @'Custom version information:' statver;
call symputx('statver',statver);
run;
Back a few years ago, some coauthors and myself composed the book on the data sets. FWIW, I do not remember that being available there.
Just thought it would be worthwhile advising that PROC PRODUCT_STATUS is now deprecated in SAS Viya and will be removed from future versions according to the documentation. Not sure if there is an alternative way to get the product version if you are running SAS/STAT on Viya.
@JeffMeyers - Yes that solution is really cool. It is writing to a SAS catalog stored in the SAS WORK library. That means when your SAS session ends it will be automatically deleted.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.