BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
JeffMeyers
Barite | Level 11

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.

1 ACCEPTED SOLUTION

Accepted Solutions
FreelanceReinh
Jade | Level 19

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;

 

View solution in original post

6 REPLIES 6
FreelanceReinh
Jade | Level 19

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;

 

Reeza
Super User
I feel like it would also be buried in one of the SASHELP libraries but I couldn't find it, albeit it wasn't a thorough search 😞
WarrenKuhfeld
Ammonite | Level 13

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.

SASKiwi
PROC Star

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
Barite | Level 11
This seems like a really cool solution and it looks like it works when I test it out. Thank you for writing this! I also like that this doesn't seem to create a physical file or write anything to the log as it would help keep my macro output clean.
SASKiwi
PROC Star

@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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1057 views
  • 10 likes
  • 5 in conversation