-
Notifications
You must be signed in to change notification settings - Fork 8
/
copypath.sas
50 lines (35 loc) · 1.49 KB
/
copypath.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
%macro CopyPath(ref) / des='Copy the path of a libname or filename';
/********************************************************************************
BEGIN MACRO HEADER
********************************************************************************
Name: CopyPath
Author: Chris Swenson
Created: 2011-07-15
Purpose: Copy the path of a libname or filename to the clipboard
Arguments: ref - either the libref or fileref to copy
Revisions
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Date Author Comments
¯¯¯¯¯¯¯¯¯¯ ¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯
YYYY-MM-DD III Please use this format and insert new entries above
********************************************************************************
END MACRO HEADER
********************************************************************************/
%if %superq(REF)=%str() %then %do;
%put %str(E)RROR: No argument specified for REF.;
%return;
%end;
%local path;
%let path=%sysfunc(pathname(%superq(REF)));
%if %superq(REF)=%str() %then %do;
%put %str(W)ARNING: The path does not exist.;
%return;
%end;
filename _cb_ clipbrd;
data _null_;
file _cb_;
put "%superq(PATH)";
run;
filename _cb_ clear;
%put NOTE: The path was copied to the clipboard.;
%mend CopyPath;