I have the following code. 
data Testing1;
	input A $ B $ C $ D $;
	datalines;
a*$"B, $%\- D_D( A&5`
;
run;
proc transpose data=testing1 out=testing1;
	var A B C D;
run;
proc sql noprint;
	select Col1 into :VarNames
		separated by '|'
	from Testing1;
quit;
%PUT VarNames=%NRBQUOTE(&VarNames.);
%LET VNum=%SYSFUNC(CountW(%NRSTR(&VarNames.),|));
%PUT VNum=&VNum.;
I am unable to get VNum to = 4. 
 
VarNames=a*$"B,|$%\-|D_D(|A&5`
with | as a delimiter, there should be 4 words. 
but VNum keeps coming out as 1