BookmarkSubscribeRSS Feed
BrunoM
Fluorite | Level 6

Hi everyone,

 

The goal of my program below is to create a XML file. The datasets on input are SAS datasets (.sas7bdat). I have an error in my SAS log and i don't understand why.

 

Here is my code. Please note that the order must be as called (DM in first then SUPPDM, etc.) : 

 

 

%macro export_xml(study=);


	libname OUT xml92 "...\FE_ECL_ETUDE_FR_EC_&study..xml" tagset=tagsets.sasxmiss  ;


		%let list_domain= DM SUPPDM DS SV CO IE MH SU TS TV TA SE CM AE SUPPAE EX TI TE SC QS SS;

		%macro read_xml;
			%let i=1;
			%let tab = %scan(&list_domain.,%eval(&i.)," ");

			%do %until (&tab. = );

				%if %sysfunc(exist(SDTM.&tab)) %then %do;

						data OUT.&tab.;
							set SDTM.&tab.;
						run;
				%end;

				%let i=%eval(&i+1) ;
				%let tab = %scan(&list_domain.,%eval(&i.)," ");

			%end;
		%mend read_xml;

		%read_xml;

%mend export_xml;

%export_xml(study=18_02768);

 

 

 

Here are the datasets called in the code

 

SAS stack overflow.PNG

And here is the first error in the log

 

NOTE: There were 67 observations read from the data set SDTM.DM.

NOTE: The data set OUT.DM has 67 observations and 28 variables.

ERROR: Event Stack Overflow. This is probably caused by mis-matched begin and end event calls.

ERROR: Event Stack Overflow. This is probably caused by mis-matched begin and end event calls.

ERROR: Event Stack Overflow. This is probably caused by mis-matched begin and end event calls.

ERROR: Event Stack Overflow. This is probably caused by mis-matched begin and end event calls.

ERROR: Event Stack Overflow. This is probably caused by mis-matched begin and end event calls.

ERROR: Event Stack Overflow. This is probably caused by mis-matched begin and end event calls.

ERROR: Event Stack Overflow. This is probably caused by mis-matched begin and end event calls.

NOTE: DATA statement used (Total process time):

real time 20.27 seconds

cpu time 19.75 seconds

 

If someone could help me on this error, I will be very gratefull.

 

Best regards,

Bruno

 

 

 

9 REPLIES 9
kiranv_
Rhodochrosite | Level 12

you are reading of datasets work fine to me. not sure there is any issue with export part.

 

%let list_domain= cars air car citiday;
		%macro read_xml;
			%let i=1;
			%let tab = %scan(&list_domain.,%eval(&i.)," ");

			%do %until (&tab. = );

				%if %sysfunc(exist(sashelp.&tab)) %then %do;

						data work.&tab.;
							set sashelp.&tab.;
						run;
				%end;

				%let i=%eval(&i+1) ;
				%let tab = %scan(&list_domain.,%eval(&i.)," ");

			%end;
		%mend read_xml;	
		
		%read_xml
RW9
Diamond | Level 26 RW9
Diamond | Level 26

So you are creating dataset.xml from your SDTM model data, correct?  Can you try it with just one dataset, then add others.  I am torn by between it being that there are multiple datasets (my first choice):

https://communities.sas.com/t5/SAS-Stored-Processes/Stream-multiple-data-sets-as-xml-output/td-p/803...

or the file size of the data.

 

Sounds to me like a roll your own dataset xml creation program is the way to go.

BrunoM
Fluorite | Level 6

Hi again and thank you for your answers !

 

"So you are creating dataset.xml from your SDTM model data, correct?"   Yes

 

I tired to create my XML with one dataset :

libname SDTM "\\Grenade\dev_sem$\_000_Clinical studies\7-Early Clinic\ANTI AGE\OUTPUT\SDTM";

libname OUT xml92 /*xmlv2*/ "\\Grenade\dev_sem$\_000_Clinical studies\7-Early Clinic\ANTI AGE\OUTPUT\XML\FE_ECL_ETUDE_FR_EC_18_02768.xml" tagset=tagsets.sasxmiss ;

data OUT.DM;
	set SDTM.DM;
run;

And i have the following log :

 

 

NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR

22

23 GOPTIONS ACCESSIBLE;

24 libname SDTM "\\Grenade\dev_sem$\_000_Clinical studies\7-Early Clinic\ANTI AGE\OUTPUT\SDTM";

NOTE: Libref SDTM was successfully assigned as follows:

Engine: V9

Physical Name: \\Grenade\dev_sem$\_000_Clinical studies\7-Early Clinic\ANTI AGE\OUTPUT\SDTM

25

26 libname OUT xml92 /*xmlv2*/ "\\Grenade\dev_sem$\_000_Clinical studies\7-Early Clinic\ANTI

26 ! AGE\OUTPUT\XML\FE_ECL_ETUDE_FR_EC_18_02768.xml" tagset=tagsets.sasxmiss ;

NOTE: Libref OUT was successfully assigned as follows:

Engine: XML92

Physical Name: \\Grenade\dev_sem$\_000_Clinical studies\7-Early Clinic\ANTI AGE\OUTPUT\XML\FE_ECL_ETUDE_FR_EC_18_02768.xml

27

28 data OUT.DM;

29 set SDTM.DM;

30 run;

NOTE: There were 67 observations read from the data set SDTM.DM.

NOTE: The data set OUT.DM has 67 observations and 28 variables.

ERROR: Event Stack Overflow. This is probably caused by mis-matched begin and end event calls.

ERROR: Event Stack Overflow. This is probably caused by mis-matched begin and end event calls.

ERROR: Event Stack Overflow. This is probably caused by mis-matched begin and end event calls.

ERROR: Event Stack Overflow. This is probably caused by mis-matched begin and end event calls.

ERROR: Event Stack Overflow. This is probably caused by mis-matched begin and end event calls.

ERROR: Event Stack Overflow. This is probably caused by mis-matched begin and end event calls.

ERROR: Event Stack Overflow. This is probably caused by mis-matched begin and end event calls.

NOTE: DATA statement used (Total process time):

real time 19.51 seconds

cpu time 19.20 seconds

 

I just don't get it.

Vince_SAS
Rhodochrosite | Level 12

The does not appear to be a problem with your code.

 

Please report this to our Technical Support Department, and supply this test code that reproduces the problem:

 

https://support.sas.com/ctx/supportform/createForm

 

%macro test;

%local I N;

%let N = 25;

%do I = 1 %to &N;

%put NOTE: >>>>>> Iteration &I of &N;

data work.class&I; set sashelp.class; run;

data out.class&I; set work.class&I; run;

%end;

%mend test;

%let FILE = C:\temp\temp.xml;

filename out "&FILE";

*  Delete the file if it exists;

data _null_;
length rc 8;
rc = fdelete('out');
run;

filename out clear;

libname out xml92 'C:\temp\temp.xml' tagset=tagsets.sasxmiss;

%TEST

 

Vince DelGobbo

SAS R&D

BrunoM
Fluorite | Level 6

Thank you for your answer !

 

For information, i tried your code and i have the same error message from iteration 20 on 25 to the end.

 

I followed the link you gave me. Thank you !

 

Best regards,

Bruno

DavidRice
Fluorite | Level 6

I know this is an old thread.  Was it ever resolved?

 

I saw a related hotfix for SAS 9.4 m7 published in August this year (Updates available for Base SAS 9.4_M7 : Hot fix I9... - SAS Support Communities).

 

I'm seeing this same issue in Viya 3.5.  I ran the sample code that Vince provided in this thread, and it makes it to the 20th iteration and then fails with the "ERROR: Event Stack Overflow. This is probably caused by mis-matched begin and end event calls." messages.

 

Thank you,
David

SASKiwi
PROC Star

The XML92 engine is extremely old having been originally released in SAS 9.2. Have you tried the XML or XMLV2 engine

DavidRice
Fluorite | Level 6

Thank you @SASKiwi for the recommendation.  That worked for the example that Vince had provided.

 

Maybe the error that I'm getting has a a different root cause.  This was the only thread that I found in SAS Communities with the "Event Stack Overflow. This is probably caused by mis-matched begin and end event calls" error message.

 

I'll start a separate thread with more specifics on the context of our issue.  I think our issue is more like what's described here: 68165 - Using the ODS POWERPOINT destination can result in the error "Event stack overflow. This is ..., but I need to work with the developer some more to get the details.

 

Thanks again!

David

 

SASKiwi
PROC Star

@DavidRice - I also noticed that there were a number of SAS notes related to the XML92 engine pointing out other problems with it. Also be wary of ODS as it has evolved rapidly over recent SAS maintenance releases so it always pays to be using the most recent releases as far as ODS is concerned.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 9 replies
  • 6329 views
  • 5 likes
  • 6 in conversation