/******************* URBAN INSTITUTE MACRO LIBRARY *********************
: DSNameOnly
Macro: Autocall macro that returns the data set name portion of a
Description
libname.dataset specification.
: Function
Use
: Peter Tatian
Author
***********************************************************************/
DSNameOnly( LibDataSpec );
%macro
/*************************** USAGE NOTES *****************************
:
SAMPLE CALLDSNameOnly( Libname.Dataset )
%
returns Dataset*********************************************************************/
/*************************** UPDATE NOTES ****************************
*********************************************************************/
***** ***** ***** MACRO SET UP ***** ***** *****;
%
%local dot Ret;
***** ***** ***** ERROR CHECKS ***** ***** *****;
%
***** ***** ***** MACRO BODY ***** ***** *****;
%
%let dot = %sysfunc( indexc( &LibDataSpec, '.' ) );
%let Ret = %sysfunc( substr( &LibDataSpec, &dot + 1 ) );
&Ret
***** ***** ***** CLEAN UP ***** ***** *****;
%
%mend DSNameOnly;
/************************ UNCOMMENT TO TEST ***************************
options mprint symbolgen mlogic;= Libname.DataSet;
%let test1 %let test1_ds = %DSNameOnly( &test1 );
=&test1 test1_ds=&test1_ds;
%put test1= DataSet;
%let test2 %let test2_ds = %DSNameOnly( &test2 );
=&test2 test2_ds=&test2_ds;
%put test2/**********************************************************************/
Dataset Name
Purpose: Autocall macro that returns the data set name portion of a libname.dataset specification