Hi all.
Can anyone help me with this problem.
I am attempting to create a macro variable that is constructed from the variables names in a target dataset.
The code I am using is pulled from the following document.
'Comparing 2 SAS Data Sets: An alternative to Using PROC COMPARE'
The methodology used is also confirmed in the online SAS doc under the entry for VARNAME.
However, when I run the code I get the following.
%macro comp_obs(dsn1,dsn2);
%let dsid=%sysfunc(open(&dsn1,i));
%let nvar1=%sysfunc(attrn(&dsid,nvars));
%do i=1 %to &nvar1;
%let name1=%sysfunc(varname(&dsid,&i));
%let list1=%str( &list1 &name1 );
%end;
%mend comp_obs;
%comp_obs(as.mm92_now,as.mm92_then);
WARNING: Apparent symbolic reference LIST1 not resolved.
ERROR: The text expression &LIST1 CHANNEL_ID contains a recursive reference to the macro variable LIST1. The macro
variable will be assigned the null value.
Anyone got any ideas what I'm doing wrong, coz I'm stumped.
Thanks for reading,
Asender...
Can anyone help me with this problem.
I am attempting to create a macro variable that is constructed from the variables names in a target dataset.
The code I am using is pulled from the following document.
'Comparing 2 SAS Data Sets: An alternative to Using PROC COMPARE'
The methodology used is also confirmed in the online SAS doc under the entry for VARNAME.
However, when I run the code I get the following.
%macro comp_obs(dsn1,dsn2);
%let dsid=%sysfunc(open(&dsn1,i));
%let nvar1=%sysfunc(attrn(&dsid,nvars));
%do i=1 %to &nvar1;
%let name1=%sysfunc(varname(&dsid,&i));
%let list1=%str( &list1 &name1 );
%end;
%mend comp_obs;
%comp_obs(as.mm92_now,as.mm92_then);
WARNING: Apparent symbolic reference LIST1 not resolved.
ERROR: The text expression &LIST1 CHANNEL_ID contains a recursive reference to the macro variable LIST1. The macro
variable will be assigned the null value.
Anyone got any ideas what I'm doing wrong, coz I'm stumped.
Thanks for reading,
Asender...