%let path=;
%let server_log=&path./server.log;
%let program_name=start_flexi_dash;
%macro multiple_xml;
data log_file(keep=txt);
length org_txt $10000 txt $10000;
infile "&server_log.";
input;
org_txt= _infile_;
if index(org_txt,"Request body-->") > 0 then
do;
txt=substr(org_txt,index(org_txt,"Request body-->")+15,length(org_txt));
output;
end;
run;
proc sql noprint;
select count(*) into :count from log_file;
quit;
%do i=1 %to &count;
data _null_;
set log_file;
if _N_= &i then
do;
file "%sysfunc(pathname(work))/xml_temp.xml";
put txt;
call symput("pgm_name",substr(txt,2,find(txt,">",2)-2 ));
end;
run;
%if &pgm_name=&program_name %then
%do;
libname lib_xml xml "%sysfunc(pathname(work))/xml_temp.xml" xmlconcatenate=yes;
data xml_table;
set lib_xml.parameters;
run;
proc transpose data=xml_table out=xml_trans;
var _all_;
run;
data _null_;
set xml_trans;
call symputx(_NAME_,strip(col1),'g');
run;
%end;
%end;
%mend;
%multiple_xml;
proc sql;
create table vars as
select name,value from dictionary.macros
where scope eq 'GLOBAL';
quit;
proc sort data=vars;
by name;
quit;
data macros(drop=value rename=(concatenate=value));
length name $100 concatenate $32767;
do until (last.name);
set vars;
by name;
concatenate = concatenate||value;
end;
run; server.log file is below : Request body--><start_flexi_dash><parameters><MEASURES3>cnt_pol_COMBINE sum_pol_COMBINE cnt_pol_QA sum_pol_QA cnt_pol_FO sum_pol_FO cnt_pol_FACNP sum_pol_FACNP cnt_pol_PQS sum_pol_PQS cnt_pol_SURPLUS1 sum_pol_SURPLUS1 cnt_pol_SURPLUS2 sum_pol_SURPLUS2 cnt_pol_FACPROP sum_pol_FACPROP cnt_pol_OTHER sum_pol_OTHER cnt_ins_COMBINE sum_ins_COMBINE cnt_ins_QA sum_ins_QA cnt_ins_FO sum_ins_FO cnt_ins_FACNP sum_ins_FACNP cnt_ins_PQS sum_ins_PQS cnt_ins_SURPLUS1 sum_ins_SURPLUS1 cnt_ins_SURPLUS2 sum_ins_SURPLUS2 cnt_ins_FACPROP sum_ins_FACPROP cnt_ins_OTHER sum_ins_OTHER</MEASURES3><OE_ID_COUNT>1</OE_ID_COUNT></parameters></start_flexi_dash> This is my exact program will look like. please copy the contents and save it as server.log and put the path of the file in the above of the sas program. The || operator here returns null value. Can you please check?
... View more