ListOpenDestinations.sas

/****************************************************************************/
/*  Program Name  : ListOpenDestinations                                    */
/*  Purpose       : Print open ODS destinations to the log.                 */
/*                                                                          */
/*--------------------------------------------------------------------------*/
/*  Author        : Matt Trzcinski                                          */
/*  Last Update   : 2017/05/06                                              */
/*                                                                          */
/*--------------------------------------------------------------------------*/
/*  Input(s)      : None                                                    */
/*  Output(s)     : Log message                                             */
/*                                                                          */
/*--------------------------------------------------------------------------*/
/*  Example(s)    : %ListOpenDestinations();                                */
/*                                                                          */
/*--------------------------------------------------------------------------*/
/*  Note          :                                                         */
/*                                                                          */
/*  Developer     :                                                         */
/*                                                                          */
/****************************************************************************/

%macro IsEmpty(macroVariable);
  %sysevalf(%superq(&macroVariable)=, boolean)
%mend;

%macro ListOpenDestinations();

  %let original_notes = %sysfunc(getoption(notes));
  options nonotes;

********************************************************************

** Append open destinations to list

********************************************************************;
  %let openDestinations=;
  proc sql noprint;
    select destination
    into : openDestinations separated by ', '
    from dictionary.destinations
    ;
  quit;

********************************************************************

** Output list

********************************************************************;
  %if %IsEmpty(openDestinations) %then
    %put ERROR- No ODS destinations are currently open.;
  %else %put WARNING- Open ODS destinations: &openDestinations;

********************************************************************

** Housekeeping

********************************************************************;
  options &original_notes;

%mend;

Powered by peut-publier

©2020 Matt Trzcinski