/***************************************************************************** * Copyright (c) 2014 by SAS Institute Inc., Cary, NC, USA. * * NAME: irmfw_createglobal.sas * * PURPOSE: Creates macro variables for global parameters * USAGE: rsk_createglobal (ds=, name_col=, var_nm=) * * ds: data set that contains the global parameters * name_col: column that contains the global parameter names var_nm: macro variable you only want to globalize. if blank, then globalize all macro var in name_col. * NOTES: * * *****************************************************************************/ %macro irmfw_createglobal (DS =, NAME_COL =, VAR_NM =) ; %rsk_trace(Entry); /*- Check to see if option dataset exists -*/ %irmfw_require_dataset(ds=&DS); %if %rsk_error_occurred %then %return; data _null_ ; set &DS; if symglobl(&NAME_COL) = 0 and symexist(&NAME_COL) = 0 then do; call execute ('%global ' !! trim(left(&NAME_COL)) !! ' ; ' ); %if &VAR_NM. NE %then %do; %let VAR_NM_QUOTE=%rsk_quote_list(list=&VAR_NM., case=UP); where upcase(&NAME_COL.) in (&VAR_NM_QUOTE.); %end; end; run; %rsk_trace(Exit); %mend;