-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathnolabel.sas
56 lines (38 loc) · 1.49 KB
/
nolabel.sas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
%macro nolabel(tables) / des='Remove labels from data set(s)';
/****************************************************************************
BEGIN MACRO HEADER
****************************************************************************
Name: nolabel
Author: Chris Swenson
Created: 2009-10-22
Purpose: Remove labels from one or more data sets
Arguments: tables - one or more tables to remove labels from
Revisions
-------------------------------------------------------------------------
Date Author Comments
---------- ------ --------
YYYY-MM-DD III Please use this format and insert new entries above
****************************************************************************
END MACRO HEADER
****************************************************************************/
%if "&tables"="" %then %do;
%put %str(E)RROR: No tables specified.;
%return;
%end;
%local num ds;
%let num=1;
%let ds=%scan(&tables, &num, %str( ));
%do %while("&ds" ne "");
%if %sysfunc(exist(&ds))>0 %then %do;
%libtbl(&ds);
/* Clear Labels on data set */
proc datasets library=&lib memtype=data nolist;
modify &tbl;
attrib _all_ label='';
run; quit;
%end;
%else %put NOTE: The table &ds does not exist.;
%let num=%eval(&num+1);
%let ds=%scan(&tables, &num, %str( ));
%end;
%mend nolabel;