Macros for SAS Application Developers
https://github.com/sasjs/core
Loading...
Searching...
No Matches
mf_getquotedstr.sas File Reference

Adds custom quotes / delimiters to a delimited string. More...

Go to the source code of this file.

Detailed Description

Can be used in open code, eg as follows:

%put %mf_getquotedstr(blah   blah  blah);

which returns:

‍'blah','blah','blah'

Alternatively:

%put %mf_getquotedstr(these words are double quoted,quote=D)

for:

‍"these","words","are","double","quoted"

Parameters
[in]in_strThe unquoted, spaced delimited string to transform
[in]dlm=(,) The delimeter to be applied to the output (default comma)
[in]indlm=( ) The delimeter used for the input (default is space)
[in]quote=(S) The quote mark to apply (S=Single, D=Double, N=None). If any other value than uppercase S or D is supplied, then that value will be used as the quoting character.
Returns
output returns a string with the newly quoted / delimited output.
Version
9.2
Author
Allan Bowe

Definition in file mf_getquotedstr.sas.