Configuration Instructions for SAS Distribution Requests

This documentation references PopMedNet 2021.1 +


PopMedNet User's Guide

Based on version 2021.1 +


Configuration Instructions for SAS Distribution Requests

The SAS Distribution functionality was adapted from the SPAN SAS query functionality in version 2.x of the PopMedNet Query Tool software.

SAS queries allow investigators to distribute SAS program files to the network DataMarts. Program files are received and executed by DataMart Administrators from within their local DataMart Client.

 

Prerequisites

  1. Successfully installed the DataMart Client (v5.0 or higher) and network connection configured.
  2. SAS (v9.1 or higher) installed.
    1. If SAS is not installed, contact your local IT department to request installation. 
  3. Winzip (v12.1 or higher) and WinZip Command Line installed
    1. WinZip and WinZip Command Line are used to encrypt the results of a SAS Distribution request prior to it being transferred back to the network Portal. WinZip is the encryption application and WinZip Command Line is an add-on that allows automatic encryption via the AutomateSASBatch.bat file, using a DOS prompt to allow DataMart Administrators to encrypt results as soon as SAS has finished processing the request.
    2. If Winzip is not installed, contact your local IT department to request installation. WinZip Command Line is a free add-on available at http://www.winzip.com/downcl.htm.
       

Configuring SAS Supporting Files

SAS Distribution requests require supporting files for successful execution. These files must be saved locally and some require manual editing.

  1. Create a new folder on your local computer and place the following files within it:
    1. AutomateSASBatch.bat
    2. EditSection.sas
    3. current_query_folder.sas

      These files may be downloaded by clicking this link: PMN SAS Distribution Support Files.zip.

      After downloading the zip file, extract the files and save them locally.

  2. Right-click AutomateSASBatch.bat and click Edit.
    1. AutomateSASBatch.bat is a DOS batch script that receives information from the DataMart Client and sequentially executes SAS programs and encrypts SAS output prior to uploading results to the network Portal.
    2. Edit the following statements:

      StatementEdit
      SET SASEXE=<pathname>\SAS.EXEReplace <pathname> with the valid path to SAS.EXE. This statement tells the DataMart Client where to find SAS.
      SET WZZIP=<pathname>\WZZIP.EXEReplace <pathname> with the valid path to WZZIP.EXE. This tells the DataMart Client where to find WinZip Command Line
      SET EditSection=<pathname>\EditSection.sasReplace <pathname> with the valid path to EditSection.sas. EditSection.sas is one of the SAS Distribution Supporting Files
      SET Current_Query_Libname=<pathname>\current_query_folder.sasReplace <pathname> with the valid path to current_query_folder.sas. current_query_folder.sas is one of the SAS Distribution Supporting Files
      SET ZIPLOG=NLeave this as is if you do not want to include log files in the encrypted zip file. Your log file will remain unencrypted locally. Change this to ZIPLOG=Y if you do want to include log files in the encrypted zip file.
    3. Save and close AutomateSASBatch.bat

  1. Open EditSection.sas in a text editor (e.g. Notepad)
    1. EditSection.sas should contain only SAS statements. EditSection.sas is executed before any other SAS statements in a SAS request. The default version of EditSection.sas contains SAS statements which are essential for SAS Distribution requests to run. Other SAS statements may be added to EditSection.sas as needed for a particular workplan.
    2. Edit the following statements:

      StatementEdit
      %INCLUDE '<pathname>\<StdVarsfilename>.sas'Replace <pathname> and <StdVarsfilename> with the valid path to and the file name of your StdVars SAS file.
      %INCLUDE '<pathname>\current_query_folder.sas'Replace <pathname> with the valid path to current_query_folder.sas. current_query_folder.sas is one of the SAS Distribution supporting files.
    3. Save and close EditSection.sas.

  2. No edits should be made to current_query_folder.sas. The initial version of current_query_folder.sas contains no text. The DataMart Client writes the name of the current query folder to this text file and SAS reads it so that SAS output can be found by WinZip and the DataMart Client.

 

 

AutomateSASBatch.bat file

Configuring the DataMart Client SAS Distribution Request Model

After editing the SAS supporting files, the DataMart Client must be told where to find AutomateSASBatch.bat and where to send SAS output.

  1. Open the DataMart Client application and click Settings.
  2. In the Network List dialog box, double-click on your network or select the network and click Edit
  3. In the Network Settings dialog box, double-click on your DataMart or select the DataMart and click Edit.
  4. In the DataMart Settings dialog box, double-click on the SAS Distribution request model or select it and click Edit.
  5. In the Model Settings dialog box, click the ellipsis button next to Command File. Use the file browser to locate the AutomateSASBatch.bat file and click Open.
  6. Click the ellipsis button next to Output Location. Use the file browser to select a folder in which SAS output will be placed. The DataMart Client will create a subfolder under this directory for every SAS request it executes.
  7. If you want to be reminded of your SAS settings before each program is run, check the "Ask before running a program" checkbox. 
    1. Note that leaving the box unchecked does not mean that SAS will execute requests automatically, only that the Command File and Output Location remain the same.
  8. Click OK on each open dialog box and close the Network List.

 

 

SAS Distribution Request Model Settings


Contact Us

PopMedNet Service Desk