while trying to export SAS dataset to xml file in specific schema
i used the below code which works fine in case the whole line length less than 200 character
<tag>+<field_name>+</tag> <=200
else only 200 character from Left hand side are written into the output file
please help as this field can be 4000 character and i cannot write it to the xml this way
or if there is a better way to write xml file using dataset which contain two columns
filename outxml '<file-path>'; data _null_; set work.<dataset_name> NOBS=lst; put '<tag>'; if (condition) then put <field_name> '</tag>' ; end; run;
Try: data _null_; file "c:\temp.xml" linesize=32767; ... run;
Or filename outxml 'c:\temp.xml' lrecl=32767;Try: data _null_; file "c:\temp.xml" linesize=32767; ... run;
Or filename outxml 'c:\temp.xml' lrecl=32767;Consider using PROC STREAM.
thanks i see it's a good option in case no condition to output if there is any way to put condition before output it would be better
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.