<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Overflow very long variable from xml file in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Overflow-very-long-variable-from-xml-file/m-p/702028#M215004</link>
    <description>&lt;P&gt;I have an xml file with a variable that runs over 100.000 bytes. I would like it to overflow into several variables. Any ideas on how to do that?&lt;/P&gt;</description>
    <pubDate>Fri, 27 Nov 2020 13:40:08 GMT</pubDate>
    <dc:creator>rudfaden</dc:creator>
    <dc:date>2020-11-27T13:40:08Z</dc:date>
    <item>
      <title>Overflow very long variable from xml file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Overflow-very-long-variable-from-xml-file/m-p/702028#M215004</link>
      <description>&lt;P&gt;I have an xml file with a variable that runs over 100.000 bytes. I would like it to overflow into several variables. Any ideas on how to do that?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Nov 2020 13:40:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Overflow-very-long-variable-from-xml-file/m-p/702028#M215004</guid>
      <dc:creator>rudfaden</dc:creator>
      <dc:date>2020-11-27T13:40:08Z</dc:date>
    </item>
    <item>
      <title>Re: Overflow very long variable from xml file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Overflow-very-long-variable-from-xml-file/m-p/702343#M215106</link>
      <description>&lt;P&gt;If you are able to import the variable into sas, I would suggest using the SCAN function to break it up!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is a similar post with some great examples:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://stackoverflow.com/questions/47693983/spliting-a-variable-into-multiple-in-sas" target="_blank"&gt;https://stackoverflow.com/questions/47693983/spliting-a-variable-into-multiple-in-sas&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Nov 2020 20:19:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Overflow-very-long-variable-from-xml-file/m-p/702343#M215106</guid>
      <dc:creator>rhaley1821</dc:creator>
      <dc:date>2020-11-29T20:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: Overflow very long variable from xml file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Overflow-very-long-variable-from-xml-file/m-p/703045#M215393</link>
      <description>&lt;P&gt;The problem is how to import such a long variable&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 09:54:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Overflow-very-long-variable-from-xml-file/m-p/703045#M215393</guid>
      <dc:creator>rudfaden</dc:creator>
      <dc:date>2020-12-02T09:54:46Z</dc:date>
    </item>
    <item>
      <title>Re: Overflow very long variable from xml file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Overflow-very-long-variable-from-xml-file/m-p/703047#M215395</link>
      <description>&lt;P&gt;You will have to dissect that data on your own. How you can do that will depend on the layout of the file; if that XML variable is contained on its own single line, in a separate block, or somehow contained within an unbroken stream of data.&lt;/P&gt;</description>
      <pubDate>Wed, 02 Dec 2020 10:08:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Overflow-very-long-variable-from-xml-file/m-p/703047#M215395</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-12-02T10:08:33Z</dc:date>
    </item>
    <item>
      <title>Re: Overflow very long variable from xml file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Overflow-very-long-variable-from-xml-file/m-p/703050#M215397</link>
      <description>&lt;P&gt;Hi Kurt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your comment. I have given an example on the data structure here. It is this part&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;TextContent&amp;gt;&lt;BR /&gt;very loon text...&lt;BR /&gt;&amp;lt;/TextContent&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;that I wan't to import. The text is a resume in plain text.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;CandidateList xmlns="http://schemas.hr-manager.net/restful/2.0/" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"&amp;gt;
&amp;lt;DocumentList&amp;gt;
&amp;lt;Document&amp;gt;
&amp;lt;Id&amp;gt;13289823&amp;lt;/Id&amp;gt;
&amp;lt;Name&amp;gt;CV name&amp;lt;/Name&amp;gt;
&amp;lt;Extension&amp;gt;pdf&amp;lt;/Extension&amp;gt;
&amp;lt;ByteCount&amp;gt;186787&amp;lt;/ByteCount&amp;gt;
&amp;lt;DownloadUrl&amp;gt;
https://cdn-recruiter.hr-manager.net/Export/Attachments/ViewDocument.aspx?cid=342&amp;amp;q=KQAAWqKhQYsY6i8aT%2byG16dhiBatjCa7wqDpBB%2flEupzmp3BQQ63DZ41fcyCwWN0
&amp;lt;/DownloadUrl&amp;gt;
&amp;lt;Bytes i:nil="true"/&amp;gt;
&amp;lt;Type&amp;gt;Cv&amp;lt;/Type&amp;gt;
&amp;lt;TextContent&amp;gt;
very loon text...
&amp;lt;/TextContent&amp;gt;
&amp;lt;/Document&amp;gt;
&amp;lt;/DocumentList&amp;gt;
&amp;lt;/CandidateList&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Dec 2020 10:31:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Overflow-very-long-variable-from-xml-file/m-p/703050#M215397</guid>
      <dc:creator>rudfaden</dc:creator>
      <dc:date>2020-12-02T10:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Overflow very long variable from xml file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Overflow-very-long-variable-from-xml-file/m-p/703070#M215404</link>
      <description>&lt;P&gt;See a very simplified example for how I would tackle such an issue:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let len=20;

data test;
infile datalines truncover;
retain id;
length id 8 text $&amp;amp;len.;
input tag $30.;
select (tag);
  when ("&amp;lt;id&amp;gt;") do;
    input id;
    input;
  end;
  when ('&amp;lt;textcontent&amp;gt;') do;
    input text $&amp;amp;len..@;
    do until (text = '&amp;lt;/textcontent&amp;gt;');
      output;
      input text $&amp;amp;len..@;
      if lengthn(text) = 0 then do;
        input;
        input text $&amp;amp;len..@;
      end; 
    end;
    input;
  end;
end;
drop tag;
datalines;
&amp;lt;id&amp;gt;
1
&amp;lt;/id&amp;gt;
&amp;lt;textcontent&amp;gt;
xxxxxxxxxxxxxxxxxxxxyyyyyyyyyyyyyyyyyyyzzzzzzzzzzzzzz
&amp;lt;/textcontent&amp;gt;
;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Dec 2020 11:14:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Overflow-very-long-variable-from-xml-file/m-p/703070#M215404</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-12-02T11:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Overflow very long variable from xml file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Overflow-very-long-variable-from-xml-file/m-p/706718#M216931</link>
      <description>&lt;P&gt;Hi Kurt.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for yor reply. Forgot to add that the data in textContent is multilined.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&amp;lt;id&amp;gt;
1
&amp;lt;/id&amp;gt;
&amp;lt;textcontent&amp;gt;CV
Hi my name is John.

I like to work with sas data.
You can call me on my phone 445-334-566

See you.

John
&amp;lt;/textcontent&amp;gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Dec 2020 17:11:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Overflow-very-long-variable-from-xml-file/m-p/706718#M216931</guid>
      <dc:creator>rudfaden</dc:creator>
      <dc:date>2020-12-17T17:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Overflow very long variable from xml file</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Overflow-very-long-variable-from-xml-file/m-p/707166#M217113</link>
      <description>&lt;P&gt;I have updated the code so that it deals correctly with data that follows the tag on the same line.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let len=20;

data test;
infile datalines truncover;
retain id;
length id 8 text $&amp;amp;len.;
input line $30.;
tag = scan(line,1,"&amp;gt;") !! "&amp;gt;";
line = scan(line,2,"&amp;gt;");
select (tag);
  when ("&amp;lt;id&amp;gt;") do;
    input id;
    input;
  end;
  when ('&amp;lt;textcontent&amp;gt;') do;
    if lengthn(line) &amp;gt; 0
    then do;
      text = line;
      output;
    end;
    input text $&amp;amp;len..@;
    do until (text = '&amp;lt;/textcontent&amp;gt;');
      output;
      input text $&amp;amp;len..@;
      if lengthn(text) = 0 then do;
        input;
        input text $&amp;amp;len..@;
      end; 
    end;
    input;
  end;
end;
drop tag;
datalines;
&amp;lt;id&amp;gt;
1
&amp;lt;/id&amp;gt;
&amp;lt;textcontent&amp;gt;CV
Hi my name is John.

I like to work with sas data.
You can call me on my phone 445-334-566

See you.

John
&amp;lt;/textcontent&amp;gt;
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 19 Dec 2020 12:54:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Overflow-very-long-variable-from-xml-file/m-p/707166#M217113</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-12-19T12:54:52Z</dc:date>
    </item>
  </channel>
</rss>

