Hi:
The error message is quite clear:
WARNING: Apparent symbolic reference RC3 not resolved.
Because when the word scanner encountered
[pre]
R&rC3
[/pre]
The word scanner interpreted the macro variable as: &RC3 and so it went to the GLOBAL symbol table and did not find &RC3 so the macro word scanner gave you a warning and the unresolved macro variable reference went forward to the code compiler. You need to delimit the &R, so that the constant C3 is not considered part of the macro variable name. A single period is used as a delimiter to tell the macro word scanner when to stopd reading characters and to start resolving. So the correct reference should have been:
[pre]
R&r.C3
[/pre]
The way the word scanner works is that the & is a macro trigger and everything between the & and the . is considered to be the macro variable reference to be looked up. Essentially, the single . disappears from the macro variable reference upon resolution. If you NEEDED to have a dot in a name, such as in a two level lib and dataset name, then you would use 2 periods, such as shown below:
[pre]
%let lib=sashelp;
%let dsn = class;
proc print data=&lib..&dsn;
run;
[/pre]
Consider this program, which duplicates your error message and shows the correct way to concatenate the 'C3' onto the &R value (program and log output both shown). Also, I believe that the correct command that you want to
generate is: [select("R1C1:R20C3")] with quotes around the row/column reference. Note that to accomplish that set of quotes -and- to have the macro variable resolved, you need to surround the row/column reference with doubled quotes, as in: putlog "[select(""R1C1:R&r.C3"")]";
cynthia
[pre]
632 data _null_;
633 set sashelp.class NOBS=rows;
634 call symput ('rows',rows);
635 run;
NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
634:23
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: DATA statement used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds
636 %put rows= &rows;
rows= 19
637
638 %let r = %eval(&rows + 1);
639 %put r= &r;
r= 20
640 %put ***** Note the use of the . (period) to indicate the end of the macro variable reference;
***** Note the use of the . (period) to indicate the end of the macro variable reference
641 %put ***** Resolved macro variable reference: r1c1:r&r.c3 ;
***** Resolved macro variable reference: r1c1:r20c3
642 %put ***** INCORRECT: r1c1:r&rc3;
WARNING: Apparent symbolic reference RC3 not resolved.
***** INCORRECT: r1c1:r&rc3
643
644 data _null_;
645 putlog '***** Test resolution of Macro variable *****';
646 putlog '***** Note the extra double quotes around the values in the SELECT command';
647 putlog '[workbook.activate("people")]';
648 putlog "[select(""R1C1:R&r.C3"")]";
649 run;
***** Test resolution of Macro variable *****
***** Note the extra double quotes around the values in the SELECT command
[workbook.activate("people")]
[select("R1C1:R20C3")]
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
[/pre]