I do not find it in the documentation. I'm always the last to know. :smileyshocked:
Thus it is equivalent to :
data _null_;
a = "Fisher's";
do q = 'A1', "A2";
x = catq(q, a);
put x= q=;
end;
run;
PG
Seems to work in 9.3 and 9.4.
How did you find it?
I found it because I was looking at the documentation for CATQ and thought why don't I try that with QUOTE. Of course it's not the same as CATQ which has the more logical 1 and 2 argument.
We should probably use CATQ('A1' to keep from breaking the "don't use undocumented features" rule.
Only trouble I have found with using CATQ is that if you want to use it with %SYSFUNC() it does not handle strings with length 0. QUOTE() is happy to handle such strings and returns two adjacent quote charaters, "" or '' if you use this newly discovered second argument.
Also this looks fishy. But maybe I did something wrong, and there is a logical explanation that I don't get.
27 %let x=%nrstr(Fisher%'s);
28 %PUT NOTE: %sysfunc(quote(&x,%str(%')));
NOTE: 'Fisher''s'
29 %PUT NOTE: %sysfunc(catq(A1,&x));
NOTE: 'Fisher''s'''
30 %PUT NOTE: %sysfunc(catq(A2,&x));
NOTE: "Fisher's'"
Another interesting note is that in SAS 8.2 and 9.2 it will accept the second argument, but it does not seem to have any effect. It will complain if you give it more than two arguments.
no second arg is documented in SAS 9.4 (TS1M1)
BUT V.GOOD TO HAVE
I'm surprised the choice is the quoting char and not S and Q
It seems that no value other than a single single quote will change default, double quote behaviour. ( but I only tested all 2byte values)
It might have been useful to support other quote symbols (OK I don't need it but I can't speak for others)
Perhaps it might be enhanced in that way before it is "formally announced"
Peter Crawford wrote:
It seems that no value other than a single single quote will change default, double quote behaviour. ( but I only tested all 2byte values)
It might have been useful to support other quote symbols (OK I don't need it but I can't speak for others)
Seems like the "quote" character could be any character with the syntax the way it is.
Where quote('Peter','t') produces tPettert
data_null_;
My experince "varied"
Only the s changed quoting.
Your experience I hoped for.
to what release must I upgrade to share your experience.
My experience is the same as yours, I did me mean to suggest otherwise. Only change is when the second argument is a single quote. Must be one byte trailing blanks don't work. I was just saying that it seems like the syntax would allow any character to be the "quote" character.
I noticed dictionary.functions shows that QUOTE as max args = 2.
My version of SAS is
NOTE: SAS (r) Proprietary Software 9.3 (TS1M2)
Interesting about dictionary.functions
You're sending me on a missionj to find differences between that and the doc (well, I'm tempted):smileymischief:
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.