<?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: SAS import entire file as a header - how do I resolve? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444440#M69379</link>
    <description>&lt;P&gt;OK - thought the first post was in the wrong discussion board.&lt;/P&gt;</description>
    <pubDate>Sat, 10 Mar 2018 19:42:04 GMT</pubDate>
    <dc:creator>belboy</dc:creator>
    <dc:date>2018-03-10T19:42:04Z</dc:date>
    <item>
      <title>SAS import entire file as a header - how do I resolve?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444423#M69375</link>
      <description>&lt;P&gt;HI,&lt;/P&gt;&lt;P&gt;I'm using the import wizard with SAS to import a MS Excel CSV file.&amp;nbsp; The problem is that SAS imports the entire file as a header with no observations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example,&lt;/P&gt;&lt;P&gt;SAS shows a 10 variable dataset with 0 observations:&lt;/P&gt;&lt;P&gt;RSID&amp;nbsp; FULLNAME&amp;nbsp; Priv&amp;nbsp; Date&amp;nbsp; EMAIL&amp;nbsp; Ugkdd10&amp;nbsp; Jason Thomas&amp;nbsp; DBA&amp;nbsp; 2008&amp;nbsp; jt@hotmail.com&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need SAS to show me a 5 variable dataset with 1 observation:&lt;/P&gt;&lt;P&gt;RSID,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;FULLNAME,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;Priv,&amp;nbsp; &amp;nbsp; &amp;nbsp;Date,&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;EMAIL&lt;/P&gt;&lt;P&gt;Ugkdd10&amp;nbsp; &amp;nbsp; &amp;nbsp; Jason Thomas&amp;nbsp; &amp;nbsp; &amp;nbsp; DBA&amp;nbsp; &amp;nbsp; &amp;nbsp;2008&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; jt@hotmail.com&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I couldn't find any documentation of how to do this.&amp;nbsp; Maybe proc transpose with some other formula?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do I need to modify the import statement or figure out a way to recreate the dataset with SAS code (i.e., SCAN, SUBSTR, etc)?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help is very much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 18:21:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444423#M69375</guid>
      <dc:creator>belboy</dc:creator>
      <dc:date>2018-03-10T18:21:40Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import entire file as a header - how do I resolve?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444436#M69376</link>
      <description>&lt;P&gt;Don't ask the same question multiple times.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 19:33:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444436#M69376</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-10T19:33:29Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import entire file as a header - how do I resolve?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444437#M69377</link>
      <description>Hi:&lt;BR /&gt;  In order to answer your question, we need to see what the CSV file actually looks like. If you open the CSV file with notepad, do you see 1 line/row in the file or 2 lines? I am guessing that there might not be a carriage control character or line feed character at the end of the header line. Instead of PROC IMPORT, you might try a DATA step program because then you could specify the delimiter and the "TERMSTR" character if, for some reason, the character used as the linefeed is not '0D0A'x.&lt;BR /&gt;&lt;BR /&gt;Please post the actual CSV file you are trying to read otherwise it's premature to consider using PROC TRANSPOSE or anything else.&lt;BR /&gt;&lt;BR /&gt;cynthia&lt;BR /&gt;cynthia</description>
      <pubDate>Sat, 10 Mar 2018 19:33:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444437#M69377</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-03-10T19:33:57Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import entire file as a header - how do I resolve?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444439#M69378</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Here is one of the CSV files... I have several just like this.&amp;nbsp; It is very short and for some reason SAS imports every last one as 5+ headers and 0 obs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 19:40:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444439#M69378</guid>
      <dc:creator>belboy</dc:creator>
      <dc:date>2018-03-10T19:40:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import entire file as a header - how do I resolve?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444440#M69379</link>
      <description>&lt;P&gt;OK - thought the first post was in the wrong discussion board.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 19:42:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444440#M69379</guid>
      <dc:creator>belboy</dc:creator>
      <dc:date>2018-03-10T19:42:04Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import entire file as a header - how do I resolve?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444443#M69380</link>
      <description>&lt;P&gt;That sample file should work fine as it is using CRLF as end of line markers.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 19:45:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444443#M69380</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-10T19:45:48Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import entire file as a header - how do I resolve?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444444#M69381</link>
      <description>&lt;P&gt;Run something like this to see what is actually in the file.&lt;/P&gt;
&lt;P&gt;This program will read 5 blocks of 100 bytes and show you what is in there.&amp;nbsp; You can check if there are CR, '0D'x, or LF, '0A'x, or both between the lines.&amp;nbsp; Also whether your delimiter is a comma or a tab, '09'x.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
 infile 'tester.csv' recfm=f lrecl=100 obs=5 ;
 input;
 list;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 19:52:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444444#M69381</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-10T19:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import entire file as a header - how do I resolve?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444445#M69382</link>
      <description>&lt;P&gt;That's what I was hoping for...but unfortunately, SAS imports everything into the header row.&lt;/P&gt;&lt;P&gt;Although&amp;nbsp; TERMSTR=CRLF , I still get everything into a header.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way I can use SUBSTR to extract certain variables/header into observations instead of headers?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any help.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 19:52:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444445#M69382</guid>
      <dc:creator>belboy</dc:creator>
      <dc:date>2018-03-10T19:52:38Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import entire file as a header - how do I resolve?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444446#M69383</link>
      <description>&lt;P&gt;Just write your own data step to read the file. For five variables it is probably less typing that writing the proc import code.&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 19:53:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444446#M69383</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-03-10T19:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import entire file as a header - how do I resolve?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444473#M69384</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Thanks for posting. It reads fine with a DATA step INFILE/INPUT. This worked for me.&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="read_csv.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/19125i0C1A9A3F4E8FB815/image-size/large?v=v2&amp;amp;px=999" role="button" title="read_csv.png" alt="read_csv.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Mar 2018 21:57:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/444473#M69384</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-03-10T21:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import entire file as a header - how do I resolve?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/445169#M69402</link>
      <description>&lt;P&gt;THANKS ALL,&lt;/P&gt;&lt;P&gt;Unfortunately these solutions didn't work for me, the solution that did work is posted below.&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13549"&gt;@Cynthia_sas&lt;/a&gt;&amp;nbsp;your solution allowed my variables to come in correctly, but I wasn't able to get the observations.&amp;nbsp; Nevertheless, I wrote my own data step that is working.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there may be a more efficient way of coding - but this works just fine so far &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data do_&amp;amp;appname;&lt;BR /&gt;set &amp;amp;folder;&lt;BR /&gt;RACFID = scan(f1,1,",");&lt;BR /&gt;'Full name'n = scan(f1,2,",");&lt;BR /&gt;Server = scan(f1,4,",");&lt;BR /&gt;KFA = scan(f1,5,",");&lt;BR /&gt;x=countw(kfa,"|");&lt;BR /&gt;do i = 1 to x;&lt;BR /&gt;x1=scan(kfa,i,"|");&lt;BR /&gt;Privilege = catx("-",scan(f1,3,","),scan(f1,4,","),x1);&lt;BR /&gt;drop i x;&lt;BR /&gt;output;&lt;BR /&gt;end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 13 Mar 2018 14:01:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/445169#M69402</guid>
      <dc:creator>belboy</dc:creator>
      <dc:date>2018-03-13T14:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: SAS import entire file as a header - how do I resolve?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/445171#M69403</link>
      <description>Hi:&lt;BR /&gt;  Since you are dealing with RACF and RACF IDs, I wonder whether you have some other type of issue with CRLF on the mainframe. I used your dataset, unedited, to generate the results shown in my screen shot. I'm glad you got it working, but you should not have to parse the way you did, if you can get the CRLF to work for the way the file was created.&lt;BR /&gt;&lt;BR /&gt;cynthia</description>
      <pubDate>Tue, 13 Mar 2018 14:07:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-import-entire-file-as-a-header-how-do-I-resolve/m-p/445171#M69403</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2018-03-13T14:07:27Z</dc:date>
    </item>
  </channel>
</rss>

