Gzip and email after table is computed

Accepted Solution Solved
Reply
Regular Contributor
Posts: 161
Accepted Solution

Gzip and email after table is computed

Dear All:

I'm wondering if it is possible to gzip the SAS dataset the code before just produced and then send me an email saying that "[sas code] completed"?

For example, I submit the following code to the Linux:

nohup sas poor_gradstudent.sas &

The code will compute an end result table mylib.want under the folder ~/projects/mylib/ with the file name want.sas7bdat.  I hope to gzip within the SAS the want.sas7bdat file to want.sas7bdat.gz and then email me saying that "poor_gradstudent.sas COMPLETED"

How could I code that?  Thanks!


Accepted Solutions
Solution
‎04-11-2014 04:27 AM
Super User
Super User
Posts: 7,432

Re: Gzip and email after table is computed

To do a zip package SAS now has a package part of ods.  Example syntax can be found below.  So basically create the output zip in your code with the files you want and then use filename email per this help: SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition

ods package(export) open nopf;

ods package(export) add file="zzz" path="xxx";

ods package(export) publish archive properties(archive_name="xxx.zip"
                                               archive_path="yyy");
ods package(export) close;

View solution in original post


All Replies
Solution
‎04-11-2014 04:27 AM
Super User
Super User
Posts: 7,432

Re: Gzip and email after table is computed

To do a zip package SAS now has a package part of ods.  Example syntax can be found below.  So basically create the output zip in your code with the files you want and then use filename email per this help: SAS(R) 9.2 Language Reference: Dictionary, Fourth Edition

ods package(export) open nopf;

ods package(export) add file="zzz" path="xxx";

ods package(export) publish archive properties(archive_name="xxx.zip"
                                               archive_path="yyy");
ods package(export) close;

Regular Contributor
Posts: 161

Re: Gzip and email after table is computed

Thank you so much RW9!

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 247 views
  • 0 likes
  • 2 in conversation