Sample 44335: SAS® Clinical Standards Toolkit - Display the current version number
The %cstutil_getcstversion macro returns the version number of the SAS® Clinical Standards Toolkit that is currently being executed in your SAS session. The product version is written to the SAS LOG. The code for the %cstutil_getcstversion macro can be found on the Full Code tab.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
Place this code in your SAS Editor window and run. The SAS Clinical Standards Toolkit product version number will be written to the SAS Log.
/* Return the SAS Clinical Standard Toolkit product version */;
/* */;
/* This is a function style macro, which will return a product version */;
/* (1.2, 1.3, 1.4, ... or a null value). */;
/* */;
/* Use: */;
/* */;
/* %put CST version: %cstutil_getcstversion */;
/* */;
/* @macrotype framework */;
/* @exposure external */;
%macro cstutil_getcstversion
/ des ='CST: Get product version';
%local _cstGlobalMDLib _cstFolder _cstTable _cstColumn _cstWhere _cstVersion
_cstfid _cstvpos _cstobs _cstvar _cstrc cstReturn;
%let _cstGlobalMDLib=_cst%sysevalf(%sysfunc(ranuni(0))*10000,floor);
%let _cstFolder=metadata;
%let _cstTable=Standards;
%let _cstColumn=productrevision;
%let _cstWhere=%str(standard="CST-FRAMEWORK" );
%let cstReturn=;
%cstutil_setcstgroot
%* Assign libname;
%let _cstrc=%sysfunc( libname( &_cstGlobalMDLib, &_cstGRoot/&_cstFolder));
%if %sysfunc(libref(&_cstGlobalMDLib))
%then %do;
%put %sysfunc(sysmsg());
%put %str(Library &_cstGlobalMDLib (&_cstGRoot/&_cstFolder)) not assigned;
%let _cstrc=%sysfunc(libname(&_cstGlobalMDLib, ""));
%end;
%else %do;
%* Open data set;
%let _cstfid = %sysfunc(open(&_cstGlobalMDLib..&_cstTable(where=(&_cstWhere)), is)) ;
%if (&_cstfid = 0) %then %do;
%put %sysfunc(sysmsg());
%end;
%else %do;
%let _cstvpos = %SysFunc( VarNum( &_cstfid, &_cstColumn)) ;
%if &_cstvpos %then %do;
%let _cstobs= %sysfunc( attrn( &_cstfid, nobs ));
%let _cstvar= %sysfunc( varnum( &_cstfid, &_cstColumn));
%do %while ( %sysfunc( fetch( &_cstfid)) ne -1 );
%let cstReturn= %sysfunc( getvarc(&_cstfid, &_cstvar ));
%end;
%end ;
%else %do;
%* &_cstColumn does not exist in data set &_cstGlobalMDLib..&_cstTable. ;
%let cstReturn=1.2;
%end;
%* Close data set and de-assign libname;
%if %sysfunc(close(&_cstfid)) %then %put %sysfunc(sysmsg());
%if %sysfunc(libname(&_cstGlobalMDLib)) %then %put %sysfunc(sysmsg());
%end;
%end;
%*;&cstReturn%*; %* 'function' return value ;
%mend cstutil_getcstversion;
%put CST Version: %cstutil_getcstversion;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
The version number will be written to the SAS Log and look like the following:
55 %put CST Version: %cstutil_getcstversion;
CST Version:1.4
This sample program illustrates how to write the current SAS® Clinical Standards Toolkit version number to the SAS Log.
Date Modified: | 2014-03-12 16:04:24 |
Date Created: | 2011-09-19 14:01:55 |
Operating System and Release Information
SAS System | SAS Clinical Standards Toolkit | Windows 7 Enterprise 32 bit | 1.4 | | 9.3 TS1M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 1.4 | | 9.3 TS1M0 | |
Microsoft Windows Server 2003 Standard Edition | 1.4 | | 9.3 TS1M0 | |
Microsoft Windows Server 2003 for x64 | 1.4 | | 9.3 TS1M0 | |
Microsoft Windows Server 2008 | 1.4 | | 9.3 TS1M0 | |
Microsoft® Windows® for x64 | 1.4 | | 9.3 TS1M0 | |
Microsoft Windows Server 2008 for x64 | 1.4 | | 9.3 TS1M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 1.4 | | 9.3 TS1M0 | |
Microsoft Windows XP Professional | 1.4 | | 9.3 TS1M0 | |
Windows 7 Enterprise x64 | 1.4 | | 9.3 TS1M0 | |
Windows 7 Home Premium 32 bit | 1.4 | | 9.3 TS1M0 | |
Windows 7 Home Premium x64 | 1.4 | | 9.3 TS1M0 | |
Windows 7 Professional 32 bit | 1.4 | | 9.3 TS1M0 | |
Windows 7 Professional x64 | 1.4 | | 9.3 TS1M0 | |
Windows 7 Ultimate 32 bit | 1.4 | | 9.3 TS1M0 | |
Windows 7 Ultimate x64 | 1.4 | | 9.3 TS1M0 | |
Windows Vista | 1.4 | | 9.3 TS1M0 | |
Windows Vista for x64 | 1.4 | | 9.3 TS1M0 | |
64-bit Enabled Solaris | 1.4 | | 9.3 TS1M0 | |
HP-UX IPF | 1.4 | | 9.3 TS1M0 | |
Linux for x64 | 1.4 | | 9.3 TS1M0 | |
Solaris for x64 | 1.4 | | 9.3 TS1M0 | |