Production Ready Macros for SAS Application Developers
https://github.com/sasjs/core
mp_zip.sas File Reference

Creates a zip file. More...

Go to the source code of this file.

Detailed Description

For DIRECTORY usage, will ignore subfolders. For DATASET usage, provide a column that contains the full file path to each file to be zipped.

%mp_zip(in=myzips,type=directory,outname=myDir)
%mp_zip(in=/my/file/path.txt,type=FILE,outname=myFile)
%mp_zip(in=SOMEDS,incol=FPATH,type=DATASET,outname=myFile)

If you are sending zipped output to the _webout destination as part of an STP be sure that _debug is not set (else the SPWA will send non zipped content as well).

SAS Macros

Parameters
in=unquoted filepath, dataset of files or directory to zip
type=(FILE) Valid values:
  • FILE - /full/path/and/filename.extension to a particular file
  • DATASET - a dataset containing a list of files to zip (see incol)
  • DIRECTORY - a directory to zip
outname=(FILE) Output file to create, without .zip extension
outpath=(sysfunc(pathname(WORK))) Parent folder for output zip file
incol=if DATASET input, say which column contains the filepath

Related Macros

Version
9.2
Author
Allan Bowe @source https://github.com/sasjs/core

Definition in file mp_zip.sas.