forked from Jiangtang/SAS_ListProcessing
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdequote.sas
33 lines (29 loc) · 1.47 KB
/
dequote.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
/*<pre><b>
/ Program : dequote.sas
/ Version : 1.0
/ Author : Roland Rashleigh-Berry (http://www.datasavantconsulting.com/roland/)
/ Date : 04-May-2011
/ Purpose : Function-style macro to remove front and end matching quotes
/ from a macro string and return the result.
/ SubMacros : %qdequote
/ Notes : This is a function-style macro that calls %qdequote and uses
/ %unquote to remove the macro quoting so that you can use it in
/ ordinary sas code.
/ Usage : %let str=%dequote(%qreadpipe(echo '%username%'));
/ %put %dequote(%qreadpipe(echo '%username%'));
/
/===============================================================================
/ PARAMETERS:
/-------name------- -------------------------description------------------------
/ str (pos) Macro string to dequote
/===============================================================================
/ AMENDMENT HISTORY:
/ init --date-- mod-id ----------------------description------------------------
/ rrb 04May11 Code tidy
/===============================================================================
/ This is public domain software. No guarantee as to suitability or accuracy is
/ given or implied. User uses this code entirely at their own risk.
/=============================================================================*/
%macro dequote(str);
%unquote(%qdequote(&str))
%mend dequote;