Date: Wed, 19 Sep 2007 00:34:06 -0700
Reply-To: Rune Runnestø <rune@FASTLANE.NO>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Rune Runnestø <rune@FASTLANE.NO>
Organization: http://groups.google.com
Subject: ERROR: Open code statement recursion detected
Content-Type: text/plain; charset="iso-8859-1"
The dataset DS1 represent metadata for generating %global statements.
These statements are
written to a file, and then included as executable code. But when
submitting the code, I get an
error message, I guess due to lacking semicolon behind some of the
statements. I can't figure out
why semicolon is missing behind some statements and not behind others.
I don't understand why
semicolon are missing at all.
data ds1;
infile datalines;
input dsname $10.;
datalines;
_Aksjer
_Ansatte
_Koder
_Kommuner
_Seltyper
_Skatter
;
run;
filename fn1 "D:\temp\fn1.sas";
%macro create_global_mvars;
data _null_;
set ds1 ;
call symput ("nr", _N_);
call symput ("dsname" ||put(_N_, 8. -L), compress(dsname));
run;
data _null_;
set ds1 end = last;
file fn1 linesize = 32767;
if _n_ = 1 then do;
%do i = 1 %to &nr;
x01 = '%global ant_' || "&&dsname&i ;" ;
put @01 x01;
%end;
end;
run;
%mend;
%create_global_mvars;
%include fn1 / source2;
/*
This is the content of D:\temp\fn1.sas:
%global ant__Aksjer ;
%global ant__Ansatte
%global ant__Koder ;
%global ant__Kommuner
%global ant__Seltyper
%global ant__Skatter
This is the message from the log:
NOTE: %INCLUDE (level 1) file FN1 is file D:\temp\fn1.sas.
2208 +%global ant__Aksjer ;
2209 +%global ant__Ansatte
2210 +%global ant__Koder ;
ERROR: Open code statement recursion detected.
2211 +%global ant__Kommuner
ERROR: Open code statement recursion detected.
2212 +%global ant__Seltyper
2213 +%global ant__Skatter
NOTE: %INCLUDE (level 1) ending.
I just wonder why the semicolon is missing behind 4 of
these 6 statements. I guess that is the reason for the
error message in the log ?
*/
Regards, Rune