The sample code on the Full Code tab illustrates how to add code to a DS2 package to return the creation date when the package is invoked.
The sample code includes these steps:
The PUT statement along with the %TSLIT macro is used to quote the macro variable (&Createdt) and write the value out to the SAS® log.
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.
libname mypck 'c:\temp';
/** Permanently save the package **/
proc ds2;
package mypck.mypkg/overwrite=yes;
method crdte();
%let filename=%sysfunc(pathname(mypck));
%let rc=%sysfunc(filename(onefile,&filename\mypkg.sas7bdat));
%let fid=%sysfunc(fopen(&onefile));
%let CreateDT=%sysfunc(finfo(&fid,Create Time));
%let fidc=%sysfunc(fclose(&fid));
%let rc=%sysfunc(filename(onefile));
put %tslit(&createdt);
end;
endpackage;
run;
quit;
/** Call the package **/
proc ds2;
data _null_;
dcl package mypck.mypkg mp();
method init();
mp.crdte();
end;
enddata;
run;
quit;
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.
Type: | Sample |
Date Modified: | 2015-04-09 14:36:58 |
Date Created: | 2015-03-20 10:44:58 |
Product Family | Product | Host | SAS Release | |
Starting | Ending | |||
SAS System | Base SAS | z/OS | 9.4 TS1M0 | |
Z64 | 9.4 TS1M0 | |||
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.4 TS1M0 | |||
Microsoft® Windows® for x64 | 9.4 TS1M0 | |||
Microsoft Windows 8 Enterprise x64 | 9.4 TS1M0 | |||
Microsoft Windows 8 Pro x64 | 9.4 TS1M0 | |||
Microsoft Windows 8.1 Enterprise 32-bit | 9.4 TS1M0 | |||
Microsoft Windows 8.1 Enterprise x64 | 9.4 TS1M0 | |||
Microsoft Windows 8.1 Pro | 9.4 TS1M0 | |||
Microsoft Windows 8.1 Pro 32-bit | 9.4 TS1M0 | |||
Microsoft Windows Server 2008 R2 | 9.4 TS1M0 | |||
Microsoft Windows Server 2008 for x64 | 9.4 TS1M0 | |||
Microsoft Windows Server 2012 Datacenter | 9.4 TS1M0 | |||
Microsoft Windows Server 2012 R2 Datacenter | 9.4 TS1M0 | |||
Microsoft Windows Server 2012 R2 Std | 9.4 TS1M0 | |||
Microsoft Windows Server 2012 Std | 9.4 TS1M0 | |||
Windows 7 Enterprise x64 | 9.4 TS1M0 | |||
Windows 7 Professional x64 | 9.4 TS1M0 | |||
64-bit Enabled AIX | 9.4 TS1M0 | |||
64-bit Enabled HP-UX | 9.4 TS1M0 | |||
64-bit Enabled Solaris | 9.4 TS1M0 | |||
HP-UX IPF | 9.4 TS1M0 | |||
Linux for x64 | 9.4 TS1M0 | |||
Solaris for x64 | 9.4 TS1M0 |