Skip to main content

Zip Data

ACCESS THE CUSTOM STEP FOLDER

Description​

The Zip Data custom step allows SAS Studio users to move or copy data to ZIP files.

The custom step includes options to specify:

  • the source directory
  • the source file pattern e.g. *.sas7bdat
  • the target directory
  • the period before which files should be archived
  • whether to move or copy files to the ZIP file
  • whether to do a "dry-run"

User Interface​

Options tab​

Standalone modeFlow mode

About tab​

Standalone & flow mode

Requirements​

Tested on SAS Viya Stable 2024.05, with Python 3.9.16 and dateutil 2.9.0.post0.

Python must be configured on the SAS Viya platform.

Usage​

Demo​

This short demo shows how to move two SAS datasets that match the filename pattern class*.sas7bdat to corresponding ZIP files named class*.sas7bdat.zip.

Custom step options​

SectionFieldDefaultDescription
Source data
Source directoryNoneSource directory on the file system. Directories in SAS Content are not supported
Source filename pattern*Filename pattern used to match files in the source directory e.g. *.sas7bdat. See the glob module for details
Target data
Target directoryNoneArchive directory on the file system. Directories in SAS Content are not supported
Archive periodArchive files with a last modified date-time before a given period. The period is specified as a number and a unit e.g. 1 month. The cutoff is calculated with dateutil.relativedelta
Number1Number of periods
UnitsmonthsPeriod unit. Select from minutes, hours, days, weeks, months, years
Action
ActionMoveMove or copy files to a ZIP file
Dry runFalseIf True, the step will run but not execute the archive step

Output​

For each file in the source directory that matches the file name pattern and modified date-time constraints, a ZIP file will be created in the archive directory.

For example, if the following source files match:

SourceArchive
[source dir]/class.sas7bdat[target dir]/class.sas7bdat.zip
[source dir]/classfit.sas7bdat[target dir]/classfit.sas7bdat.zip

Change Log​

  • Version: 1.0 (25JUN2024)

    • Initial version
  • Created/contact: