12-11-2014 07:06 AM
Read a lot of solution how to read testfiles from a zip-file.
I want to zip testfiles from a specifik folder to an compressed folder. But not all files in that folder, want to use the timestamp on the files.
ex in the folder: C:\logg\SASLogg
i have those files:
i want to use todays date and compress all files that is older than 7 Days alt or only the files that is 7 Days old.
Some one that have any ide how the SAS-code should look like?
12-18-2014 04:05 AM
Look up ods package. With this you can create a ZIP file and add files into it. It doesn't require a zip app installed, or OS calls:
ods package(MyPackage) open nopf;
ods package(MyPackage) add file="...\yourfile.log";
ods package(MyPackage) publish archive properties(archive_name="xyzzip" archive_path="c:\temp");
12-18-2014 02:13 AM
filename oscmd pipe 'dir C:\logg\SASLogg';
infile oscmd truncover;
format file_name $100.;
file_name = scan(_infile_,1,'.');
file_date = input(substr(file_name,length(file_name)-6),date7.);
if (insert condition here) then call system(insert zip command here);