<?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 Re: How to import a positional text file using XML file in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-a-positional-text-file-using-XML-file/m-p/314954#M21246</link>
    <description>&lt;P&gt;Or save as CSV from Excel and import.&lt;/P&gt;</description>
    <pubDate>Mon, 28 Nov 2016 20:46:27 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2016-11-28T20:46:27Z</dc:date>
    <item>
      <title>How to import a positional text file using XML file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-a-positional-text-file-using-XML-file/m-p/314924#M21244</link>
      <description>&lt;P&gt;Hi everyone,&lt;BR /&gt;&lt;BR /&gt;I have several data files need to import in EG, that comes like:&lt;BR /&gt;&lt;BR /&gt;TXT FILE&lt;BR /&gt;&lt;BR /&gt;0000280727000004825100000078690010001000005A0000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001&lt;BR /&gt;&lt;BR /&gt;XML FILE&lt;BR /&gt;&lt;BR /&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;BR /&gt;&lt;BR /&gt;-&amp;lt;FlatFileDefinition ZipName="" FileName="positional.txt" TemplateName="MMM MIX - v2 Catlg TXT"&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-&amp;lt;Columns&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;Column Type="Field" Repeat="1" Length="10" Start="1" Name="Code"/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;Column Type="Field" Repeat="1" Length="10" Start="11" Name="Ncc"/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;Column Type="Field" Repeat="1" Length="10" Start="21" Name="Prov_cod"/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;Column Type="Field" Repeat="1" Length="3" Start="31" Name="Regi_Cod"/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;Column Type="Field" Repeat="1" Length="4" Start="34" Name="Dist_Cod"/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;Column Type="Field" Repeat="1" Length="6" Start="38" Name="Terr_Cod"/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;Column Type="Field" Repeat="1" Length="1" Start="44" Name="Clie_Let"/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;Column Type="Measure" Repeat="12" Length="15" Start="45" Name="Units_Period"/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;Column Type="MeasureControl" Repeat="1" Length="25" Start="225" Name="Sum_Total"/&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;/Columns&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;/FlatFileDefinition&amp;gt;&lt;BR /&gt;&lt;BR /&gt;How to make EG interpret this XML file like the line format/delimiter? Or any other possible solution....&lt;BR /&gt;&lt;BR /&gt;Thanks in advance&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 19:03:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-a-positional-text-file-using-XML-file/m-p/314924#M21244</guid>
      <dc:creator>pedrohtr</dc:creator>
      <dc:date>2016-11-28T19:03:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a positional text file using XML file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-a-positional-text-file-using-XML-file/m-p/314938#M21245</link>
      <description>For your consideration: open XML in Excel and saving it in Excel format.  Then import Excel into SAS.</description>
      <pubDate>Mon, 28 Nov 2016 20:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-a-positional-text-file-using-XML-file/m-p/314938#M21245</guid>
      <dc:creator>Haris</dc:creator>
      <dc:date>2016-11-28T20:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a positional text file using XML file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-a-positional-text-file-using-XML-file/m-p/314954#M21246</link>
      <description>&lt;P&gt;Or save as CSV from Excel and import.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Nov 2016 20:46:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-a-positional-text-file-using-XML-file/m-p/314954#M21246</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-11-28T20:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a positional text file using XML file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-a-positional-text-file-using-XML-file/m-p/315085#M21255</link>
      <description>&lt;PRE&gt;
Use the following to get data structure from xml.
After that make a macro or CALL EXECUTE() to import that TXT file.


filename x temp;
libname xx xmlv2 '/folders/myfolders/have.xml' automap=replace xmlmap=x;
proc copy in=xx out=work;
run;
&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Nov 2016 04:27:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-a-positional-text-file-using-XML-file/m-p/315085#M21255</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-29T04:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a positional text file using XML file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-a-positional-text-file-using-XML-file/m-p/315096#M21258</link>
      <description>&lt;PRE&gt;

data have;
infile '/folders/myfolders/have.xml' dlm='"/' ;
input @'Type=' type : $40. @'Repeat=' repeat : $40.
      @'Length=' length : $40. @'Start=' start : $40. 
      @'Name=' name : $40. ;    
run;
data name;
 set have;
 num_repeat=input(repeat,best.);
 num_len=input(length,best.);
 num_start=input(start,best.);
 do i=1 to num_repeat;
  vname=catx('_',name,i);
  col=catx('-',num_start,num_start+num_len);
  num_start=num_start+num_len;
  output;
 end;
run;
proc sql noprint;
select catx(' ',vname,'$',col) into : list separated by ' '
 from name;
quit;
%put &amp;amp;list ;
data want;
 infile '/folders/myfolders/have.txt' lrecl=320000 pad;
 input &amp;amp;list ;
run;

&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Nov 2016 05:25:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-a-positional-text-file-using-XML-file/m-p/315096#M21258</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2016-11-29T05:25:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to import a positional text file using XML file</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-a-positional-text-file-using-XML-file/m-p/315686#M21287</link>
      <description>Excelent way to solve Ksharp!&lt;BR /&gt;Thanks a lot! Worked fine.</description>
      <pubDate>Wed, 30 Nov 2016 20:52:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/How-to-import-a-positional-text-file-using-XML-file/m-p/315686#M21287</guid>
      <dc:creator>pedrohtr</dc:creator>
      <dc:date>2016-11-30T20:52:25Z</dc:date>
    </item>
  </channel>
</rss>

