05-23-2015 04:47 PM
I have the following code and trying to extract first word (QTcF) how can i achieve this?
input seq param $ 2-80;
1 QTcB - Bazett's Correction Formula (msec)
call symput ("param", cats(param));
%put ¶m; ( this is not resolved in log)
When i am doing the following way i get an error in the log
%let x = %scan("¶m",1,-));
ERROR: Open code statement recursion detected.
05-23-2015 10:40 PM
First issue is that you are unable to create a macro variable where the value has a unbalanced quote. To avoid this you need to try the following code
call symputx('param', quote(trim(param)));
it will create the param macro variable with value. Then to get the QTCB please try
%let x = %substr(%qsysfunc(scan(¶m,1,'-')),2);
First it will extract the QTCB and then it will remove the first quote by substr.
Please try and let me know if it was helpful.
05-23-2015 10:57 PM
Actually it's okay to have an unmatched quote inside a macro variable, as long as you macro quote it when you use it. The following should work:
%let x = %scan(%superq(param),1,-) ;
Worked for me on free SAS University Edition running on AWS. So cool to have that. Thank you SAS.