/* Change this to suit your environment */ %let projectDir = c:\projects\sgf2013\filenamezip; /* Clean slate! */ filename newfile "&projectDir./carstats.zip"; data _null_; if (fexist('newfile')) then rc = fdelete('newfile'); run; filename newfile clear; /* Create folder if it doesn't exist */ options dlcreatedir; libname out "&projectDir./data"; /* Create some data */ filename newcsv "&projectDir./data/pct.csv"; proc means noprint data=sashelp.cars; var msrp; output out=out.pct median=p50 p95=p95 p99=p99; run; ods csv file=newcsv; proc print data=out.pct; format _all_; /* clear the formats */ run; ods csv close; /* Create an informative document about this package */ filename rm "&projectDir./readme.rtf"; ods rtf(readme) file="&projectDir./readme.rtf" style=Printer; ods rtf(readme) text="These are some instructions for what to do next"; proc datasets lib=out nolist; contents data=pct; quit; ods rtf(readme) close; /* Creating a ZIP file with ODS PACKAGE */ ods package(newzip) open nopf; ods package(newzip) add file=newcsv path="data/"; ods package(newzip) add file=rm; ods package(newzip) publish archive properties( archive_name="carstats.zip" archive_path="&projectDir." ); ods package(newzip) close;