<?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: Identify row with first occurrence of a string (searching all variables) in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Identify-row-with-first-occurrence-of-a-string-searching-all/m-p/782787#M249553</link>
    <description>&lt;P&gt;It would help if you could post an example of a sheet you are trying to import. Dummy data is fine if the original data is confidential.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd suggest using the XLSX engine in a SAS LIBNAME statement pointing at one of the Excel workbooks, then reading the required worksheet in using a SAS Data Step.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 28 Nov 2021 21:35:53 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2021-11-28T21:35:53Z</dc:date>
    <item>
      <title>Identify row with first occurrence of a string (searching all variables)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identify-row-with-first-occurrence-of-a-string-searching-all/m-p/782782#M249552</link>
      <description>&lt;P&gt;Problem:&lt;/P&gt;&lt;P&gt;I have 1000s of xlsx sheets that I'm importing. However, they are poorly structured but contain a table that all start with a date-column with either 'date' or 'testdate' as column header (then the column contains dates). This keyword/header can be in various positions in excel (eg row 3 and column 4 or row 5 and column 3).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Solution:&lt;/P&gt;&lt;P&gt;Import xlsx file&lt;/P&gt;&lt;P&gt;create a variable with row-nr (_N_)&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Identify row position of keyword ('date' or 'testdate')&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;import xlsx file at rownum = position given above to capture headers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem lies in identifying the first occurrence of date or testdate searching all columns with unknown column names.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Nov 2021 21:10:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identify-row-with-first-occurrence-of-a-string-searching-all/m-p/782782#M249552</guid>
      <dc:creator>td1345</dc:creator>
      <dc:date>2021-11-28T21:10:44Z</dc:date>
    </item>
    <item>
      <title>Re: Identify row with first occurrence of a string (searching all variables)</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Identify-row-with-first-occurrence-of-a-string-searching-all/m-p/782787#M249553</link>
      <description>&lt;P&gt;It would help if you could post an example of a sheet you are trying to import. Dummy data is fine if the original data is confidential.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'd suggest using the XLSX engine in a SAS LIBNAME statement pointing at one of the Excel workbooks, then reading the required worksheet in using a SAS Data Step.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Nov 2021 21:35:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Identify-row-with-first-occurrence-of-a-string-searching-all/m-p/782787#M249553</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-11-28T21:35:53Z</dc:date>
    </item>
  </channel>
</rss>

