I need to parse an XML that is stored in a database column (the whole XML in 1 column). To get around the 32K string limit, I've split up the xml to multiple parts in a query and then tried to place them in one file for processing. Code below: CREATE TABLE work.table AS
SELECT * FROM connection to src(
SELECT date, market,
substring(content, 1, 30000) as xml_1,
substring(content, 30001, 30000) as xml_2,
substring(content, 60001, 30000) as xml_3,
substring(content, 90001, 30000) as xml_4,
substring(content, 120001, 30000) as xml_5,
substring(content, 150001, 30000) as xml_6,
substring(content, 180001, 30000) as xml_7,
substring(content, 210001, 30000) as xml_8,
substring(content, 240001, 30000) as xml_9
FROM table); disconnect from src; Quit;
filename xml_file 'path/xml.xml';
data _null_;
set table_from_query;
output;
file xml_file;
put xml_1 xml_2 xml_3 xml_4 ... xml_9;
run; It all works as I expect it, but when I look at the xml created "xml_file" In the places that they were joined (xml_i ends and xml_i+1 starts) they are not placed on the same line. Some breaks do not cause errors, but some do as they split the actual tag. Example below: <Interval NUM=""33"">
<IntervalEnding>08:15</IntervalEndin <----- Split causing error >
g>
<IntervalValue>63.25</IntervalValue>
</Interval>
<Interval NUM=""34"">
<IntervalEnding>08:30</IntervalEnding>
<IntervalValue>50.84</IntervalValue>
</Interval> How can I start the new input on the same line as before? I've tried @ after put, but it is the same result. Any help is appreciated. Side note: put xml_: doesn't work instead of naming all xml_1 through xml_9.
... View more