If you need to export SAS data into a XML file than you have several options.
One possibility is a manual export via datastep.
Please take into account that the XML „child“ data must be stored horizontal in the SAS table.
You can access this SAS „child“ data later by using n-dimensional arrays.
The following example shows how it works.
The „+(-1)“ is a pointer to avoid blanks in the final XML file.
filename outxml „[yourPath]“;
data _null_;
file outxml;
set input NOBS=Lst;
by custid;
%let tab=“ „;
array var_a{3};
array var_b{3, 8} var_b1_1-var_b1_8
var_b2_1-var_b2_8
var_b3_1-var_b3_8;
if _n_=1 then do;
put ‚<?xml version=“1.0″ encoding=“windows-1252″?>‘;
put ‚<tns:DATAFILE Producer=“SAS“ ProductionTime=“‚;
put ‚ xmlns:tns=“http://…“‚;
put ‚ xmlns:xsi=“http://…“‚;
put ‚ xsi:schemaLocation=“http://…“>‘;
end;
put;
put ‚ <tns:Update…Record>‘;
put ‚ <tns:CustomerID>‘ custid +(-1) ‚</tns:CustomerID>‘;
do i=1 to 3 by 1;
if var_a{i} ne . then do;
put ‚ <tns:AccountData DateOfInfo=today‘;
put ‚ <tns:AccountNumber>‘ var_a{i} +(-1) ‚</tns:AccountNumber>‘;
put ‚ <tns:AccountType>F</tns:AccountType>‘;
do m = 1 to 8;
if var_b{i, m} ne . then do;
put ‚ <tns:CardNumber>‘ var_b{i, m} +(-1) ‚</tns:CardNumber>‘;
end;
end;
put ‚ </tns:AccountData‘;
end;
end;
put ‚ </tns:Update…Record>‘;
run;