<?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 skip rows with retain statment? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/How-to-skip-rows-with-retain-statment/m-p/130154#M35435</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your quick reply, I will try and learn your code atm.So late on I recieved another txt file from the client again now all the "tab" changed to "space" does the expandtabs effected with your code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 07 May 2013 00:27:42 GMT</pubDate>
    <dc:creator>Elenatec</dc:creator>
    <dc:date>2013-05-07T00:27:42Z</dc:date>
    <item>
      <title>How to skip rows with retain statment?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-skip-rows-with-retain-statment/m-p/130152#M35433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am new to SAS very much appreciated from your reply. My client gave me a txt file which look like the file I have attached, I would like to know how use SAS to capture valid data or skip unessary rows from the raw files and replace those empty column such as date and area.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 May 2013 09:39:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-skip-rows-with-retain-statment/m-p/130152#M35433</guid>
      <dc:creator>Elenatec</dc:creator>
      <dc:date>2013-05-06T09:39:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip rows with retain statment?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-skip-rows-with-retain-statment/m-p/130153#M35434</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;filename x&amp;nbsp; 'c:\temp\query1.txt';
data x;
 infile x&amp;nbsp; expandtabs&amp;nbsp; pad ;
 input @;
 if left(_infile_) in: ('FIles' 'Date' '======') or missing(_infile_) then delete;
&amp;nbsp; else&amp;nbsp; input date $ 8-16 area $ 22-28 id $ 31-39 type $ 40-44 country $ 47-65;
run;
data want;
 set x;
 retain _d _a '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ';
 if not missing(date) then _d=date;
 if not missing(area) then _a=area;
 date=coalescec(date,_d);
 area=coalescec(area,_a);
 drop _d _a;
run;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 06 May 2013 12:44:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-skip-rows-with-retain-statment/m-p/130153#M35434</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-05-06T12:44:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip rows with retain statment?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-skip-rows-with-retain-statment/m-p/130154#M35435</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for your quick reply, I will try and learn your code atm.So late on I recieved another txt file from the client again now all the "tab" changed to "space" does the expandtabs effected with your code?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 00:27:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-skip-rows-with-retain-statment/m-p/130154#M35435</guid>
      <dc:creator>Elenatec</dc:creator>
      <dc:date>2013-05-07T00:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip rows with retain statment?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-skip-rows-with-retain-statment/m-p/130155#M35436</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;NO. You can use it without change.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 01:31:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-skip-rows-with-retain-statment/m-p/130155#M35436</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-05-07T01:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip rows with retain statment?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-skip-rows-with-retain-statment/m-p/130156#M35437</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many Thanks, I am totally new to this SAS even I have basic programming languages knowledge still can't complete my work, very much appreciated from your help. one last questiong about the code&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;retain _d _a '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;whats the purpose of the last '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' section?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 02:37:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-skip-rows-with-retain-statment/m-p/130156#M35437</guid>
      <dc:creator>Elenatec</dc:creator>
      <dc:date>2013-05-07T02:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to skip rows with retain statment?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/How-to-skip-rows-with-retain-statment/m-p/130157#M35438</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assign '&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; '&amp;nbsp;&amp;nbsp;&amp;nbsp; as initial value of _d and _a &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 07 May 2013 03:41:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/How-to-skip-rows-with-retain-statment/m-p/130157#M35438</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2013-05-07T03:41:27Z</dc:date>
    </item>
  </channel>
</rss>

