<?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: variable names in &amp;quot;row 2&amp;quot; how to let PROC IMPORT to start from the 2rd row? in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/511406#M73062</link>
    <description>&lt;P&gt;We can use 'Range' to import specific row/columns from the input file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;import&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;out&lt;/FONT&gt; &lt;FONT face="helvetica"&gt;&lt;EM&gt;= &lt;FONT face="Courier New" size="3"&gt;work.input_file datafile=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'c:\temp\class.xlsx'&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;dbms&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=xlsx &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;replace&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;range&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"'Data - Groups'$A7 : O12"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;GETNAMES&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=YES;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica"&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica"&gt;&lt;EM&gt;Thanks&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Nov 2018 15:31:13 GMT</pubDate>
    <dc:creator>VioSas</dc:creator>
    <dc:date>2018-11-08T15:31:13Z</dc:date>
    <item>
      <title>variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68009#M19464</link>
      <description>variable names in row 2, &lt;BR /&gt;
data starts from row 3&lt;BR /&gt;
&lt;BR /&gt;
is there any option to control this? Thanks

Message was edited by: Ken_oy</description>
      <pubDate>Tue, 01 Feb 2011 17:11:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68009#M19464</guid>
      <dc:creator>Ken_oy</dc:creator>
      <dc:date>2011-02-01T17:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68010#M19465</link>
      <description>&lt;P&gt;&lt;FONT face="helvetica"&gt;&lt;EM&gt;Editor’s Note: This is a popular topic. Thanks to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12"&gt;@deleted_user&lt;/a&gt; for providing the solution below for .XLS and delimited files. Thanks to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt; for sample code solution for .XLS files and to &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/61712"&gt;@sundeep15685&lt;/a&gt; for providing a .XLSX file sample code solution. &amp;nbsp;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="helvetica"&gt;&lt;EM&gt;Additional information for comma, tab or delimited files: There is not an option to tell SAS which record to pick up the variable names from when reading a comma, tab or delimited file. If your variable names are not on row 1, then you will need to use the GETNAMES=NO and DATAROW=n where n is the starting record of your data. Here is an example of skipping the first rows of data and reading data starting from row 4 while SAS assigns the variable names as VARn where n is a number:&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="helvetica"&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="helvetica"&gt;&lt;EM&gt;proc import datafile='c:\temp\class.csv' out=class dbms=csv replace;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="helvetica"&gt;&lt;EM&gt;getnames=no;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="helvetica"&gt;&lt;EM&gt;datarow=4;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="helvetica"&gt;&lt;EM&gt;run;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hello,&lt;BR /&gt; &lt;BR /&gt; you didn' mention what kind of file you are trying to import (delimited, xls)...&lt;BR /&gt; &lt;BR /&gt; if your file is of .xls type you can adjust the import procedure with RANGE and GETNAMES=YES options.&lt;BR /&gt; &lt;BR /&gt; if your file is of .txt type:&lt;BR /&gt; - you can switch from import procedure to date step with infile (with option firstobs=3) and input statements (with variables named here)&lt;BR /&gt; - you can use import procedure with GETNAMES=NO, DATAROW=3, GUESSINGROWS= (default 20 - you may increase it depending on your file size) and after importing it use a data step or proc datasets to change the variables name.&lt;BR /&gt; &lt;BR /&gt; HTH,&lt;BR /&gt; Marius&lt;/P&gt;</description>
      <pubDate>Mon, 19 Dec 2016 14:29:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68010#M19465</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2016-12-19T14:29:04Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68011#M19466</link>
      <description>Assuming this is some sort of text file.&lt;BR /&gt;
&lt;BR /&gt;
If I only had one file to read: Remove the first line then proceed with import.&lt;BR /&gt;
&lt;BR /&gt;
If I had multiple files in the exact same format: Remove the first line from one file. &lt;BR /&gt;
Use Proc Import, Copy the code from the LOG that was generated to read the file,&lt;BR /&gt;
clean it up, modify the FIRSTOBS=2 to FIRSTOBS=3 and use appropriate FILENAME references to read each file.&lt;BR /&gt;
&lt;BR /&gt;
I use the second frequently as my clients change data file layouts frequently. I then modify the informat, format and input statements as well as adding labels and any calculated variables.</description>
      <pubDate>Wed, 02 Feb 2011 20:58:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68011#M19466</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2011-02-02T20:58:29Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68012#M19467</link>
      <description>Hi.&lt;BR /&gt;
[pre]&lt;BR /&gt;
proc import file='c:\temp\op.xls' out=op dbms=xls replace;&lt;BR /&gt;
                                               namerow=2;&lt;BR /&gt;
                                               startrow=3;&lt;BR /&gt;
                                               getnames=yes;&lt;BR /&gt;
                                               run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
But this way is not suited for office2007.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ksharp</description>
      <pubDate>Wed, 16 Feb 2011 05:05:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68012#M19467</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2011-02-16T05:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68013#M19468</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; How do you use namerow and startrow options with range option to import&amp;nbsp; excel files with xlsx extension&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2011 12:23:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68013#M19468</guid>
      <dc:creator>rsva</dc:creator>
      <dc:date>2011-07-29T12:23:57Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68014#M19469</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't unless the file is small enough that you can save it as an older version (i.e., xls) of Excel.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2011 12:50:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68014#M19469</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2011-07-29T12:50:00Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68015#M19470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; Thanks. I was planning to do that. But I have to resave 50 files. I wanted to see if there is a easier way to do it SAS with existing file extension.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Jul 2011 13:00:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68015#M19470</guid>
      <dc:creator>rsva</dc:creator>
      <dc:date>2011-07-29T13:00:44Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68016#M19471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Date: 30/04/2012&lt;/P&gt;&lt;P&gt;Limits &amp;amp; Utilization Report&lt;/P&gt;&lt;P&gt;Risk Type: CRE_RT&lt;/P&gt;&lt;P&gt;Entity: DBS SIN&lt;/P&gt;&lt;P&gt;Segment Code: Emerging Business (25, 30)&lt;/P&gt;&lt;P&gt;SEGMENT CODE;RMNAME;COUNTERPARTY GROUP;COUNTERPARTY;COUNTERPARTYFULLNAME;LIMITGROUP;PILLAR;CURRENCY;LIMITS;UTILIZATION;AVAILABLE;EXPIRYDATE;LIMITCOMMENT;CIFNUMBER;MARKETVALUE;MARKETVALUEGROSS;ADDON;ADDONGROSS&lt;/P&gt;&lt;P&gt;15;BBCSC 83 EMBZ - NON;3DXXRESPT1;3DXXRESPT1;3D COMPANY PTE. LTD.;FX;O/N;USD;55000;0.00;55000.00;;;30202040;0.000000;0.000000;0.000000;0.000000&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC IMPORT DATAFILE='\\Portfolio Data\FX\lim_util_cre_rt_15_20.csv'&lt;/P&gt;&lt;P&gt;&amp;nbsp; OUT=FX_THISMONTH &lt;/P&gt;&lt;P&gt;&amp;nbsp; DBMS=CSV&amp;nbsp; REPLACE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; GETNAMES=NO;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DELIMITER=';';&lt;/P&gt;&lt;P&gt;&amp;nbsp; DATAROW=7;&lt;/P&gt;&lt;P&gt;&amp;nbsp; GUESSINGROWS=10000;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The header row is 6 and data row starts at 7. How do I set PROC IMPORT to get the headers from row-6?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Jun 2012 08:15:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68016#M19471</guid>
      <dc:creator>hellind</dc:creator>
      <dc:date>2012-06-16T08:15:23Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68017#M19472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think your code looks good . Didn't it work ?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC IMPORT DATAFILE='\\Portfolio Data\FX\lim_util_cre_rt_15_20.csv'&lt;/P&gt;&lt;P&gt;&amp;nbsp; OUT=FX_THISMONTH &lt;/P&gt;&lt;P&gt;&amp;nbsp; DBMS=CSV&amp;nbsp; REPLACE;&lt;/P&gt;&lt;P&gt;&amp;nbsp; GETNAMES=NO;&lt;/P&gt;&lt;P&gt;&amp;nbsp; DELIMITER=';';&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;STRONG&gt;DATAROW=6;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; GUESSINGROWS=10000;&lt;/P&gt;&lt;P&gt;RUN;&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, 18 Jun 2012 01:58:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68017#M19472</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-06-18T01:58:14Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68018#M19473</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Row-6 should be the header, and Row-7 is the data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I had to use multile proc import and proc export to get the data I want, with row-6 as header and row-7 as data. I was hoping to acheive that in one proc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __default_attr="sql" __jive_macro_name="code" class="jive_text_macro jive_macro_code _jivemacro_uid_13400164279561470" jivemacro_uid="_13400164279561470"&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;PROC IMPORT DATAFILE='\\Portfolio Data\FX\lim_util_cre_rt_15_20.csv'&lt;/P&gt;
&lt;P&gt;&amp;nbsp; OUT=FX_THISMONTH&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DBMS=CSV&amp;nbsp; REPLACE;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; GETNAMES=NO;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DELIMITER=';';&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DATAROW=6;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; GUESSINGROWS=10000;&lt;/P&gt;
&lt;P&gt;RUN;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;filename exTemp temp;&lt;/P&gt;
&lt;P&gt;proc export data=FX_THISMONTH&lt;/P&gt;
&lt;P&gt;&amp;nbsp; outfile=exTemp&lt;/P&gt;
&lt;P&gt;&amp;nbsp; dbms=csv REPLACE;&lt;/P&gt;
&lt;P&gt;run;&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;P&gt;filename exTemp1 temp;&lt;/P&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; infile exTemp firstobs=2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; file exTemp1;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; input;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp; put _infile_;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;PROC IMPORT DATAFILE =exTemp1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; OUT=FX_THISMONTH1&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DBMS=CSV REPLACE;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; GETNAMES=YES;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; DATAROW=2;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; GUESSINGROWS=10000;&lt;/P&gt;
&lt;P&gt;RUN;&lt;/P&gt;


&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am using SAS 9.1.3 and hence I can't use PUTNAMES in proc export.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Jun 2012 10:44:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68018#M19473</guid>
      <dc:creator>hellind</dc:creator>
      <dc:date>2012-06-18T10:44:40Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68019#M19474</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or you can firstly delete the first 6 row in CSV file, as you did .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;PRE&gt;&lt;/PRE&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>Tue, 19 Jun 2012 02:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68019#M19474</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-06-19T02:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68020#M19475</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, &lt;/P&gt;&lt;P&gt;I have the same issue but using Ksharp's code doesn't work, Am I doing anything wrong?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PROC IMPORT FILE="C:\Users\galeshi\Desktop\ALI\CV.CSV" out=CV dbms=CSV replace;&lt;/P&gt;&lt;P&gt;namerow=2;&lt;/P&gt;&lt;P&gt;startrow=3;&lt;/P&gt;&lt;P&gt;getnames=yes;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 21:52:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68020#M19475</guid>
      <dc:creator>R_A_G_</dc:creator>
      <dc:date>2013-01-02T21:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68021#M19476</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you try his second set of code (i.e., the one just above your post)?,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Some of the options you are specifying are only for importing excel files.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 02 Jan 2013 22:50:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/68021#M19476</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-01-02T22:50:15Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/225796#M53977</link>
      <description>&lt;P&gt;try &amp;nbsp; &amp;nbsp;getnames=no&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 16 Sep 2015 11:21:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/225796#M53977</guid>
      <dc:creator>phani9909</dc:creator>
      <dc:date>2015-09-16T11:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/240917#M55663</link>
      <description>&lt;P&gt;Check this code if your file is in xlsx format.&lt;/P&gt;&lt;P&gt;In the range statement, you can change it if your data starts from 3rd row or any row.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC IMPORT DATAFILE="c:\users\asr\desktop\sas practice\tasktwo.xlsx"&lt;BR /&gt;OUT=sports_sale&lt;BR /&gt;DBMS=XLSX&lt;BR /&gt;REPLACE;&lt;BR /&gt;range="input$A2:C2000";&lt;BR /&gt;Getnames=yes;&lt;BR /&gt;informat Time_stamp datetime16.;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 27 Dec 2015 15:44:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/240917#M55663</guid>
      <dc:creator>sundeep15685</dc:creator>
      <dc:date>2015-12-27T15:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/305985#M60951</link>
      <description>&lt;P&gt;I read in from row 2 as a character dataset since names will be characters. Save as a csv file without putting names, then read in from csv file getting names. Sample&amp;nbsp;code below for a tab delimited source file:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc import out=test file="&amp;amp;path\tabfile" dbms=tab replace;&lt;BR /&gt;getnames=no; datarow=2; guessingrows=9999; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc export data=test file="&amp;amp;path\tabfile.csv" dbms=csv replace;&lt;BR /&gt;putnames = no; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc import out=mydata&amp;nbsp;file="&amp;amp;path\tabfile.csv" dbms=csv replace;&lt;BR /&gt;getnames=yes; guessingrows=9999; run;&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 15:58:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/305985#M60951</guid>
      <dc:creator>daren</dc:creator>
      <dc:date>2016-10-20T15:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/411594#M67357</link>
      <description>&lt;P&gt;I found that the NAMEROW option only works for Excel files, not CSVs (or other delimited text files).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The way I solved a similar problem (the first 9 lines of each text file are file headers, not column headings - those are on line 10 with data starting at line 11) was to use a temporary file where the output of the original starts at the line with the column labels.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, my code looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  /* Need to cut the first 9 rows that do not contain header info */
   options obs=50; /* just use 50 lines for testing purposes - set to max to production */
   filename tempdata temp;

     data _null_;
       infile "&amp;amp;filenm." 
           firstobs=10
           lrecl=32760
           dlm=','
           missover
           dsd ;
       file tempdata dlm=',' lrecl=32760;
       input;
       put _infile_;
     run;

   /* import from temp file */
   proc import out=work.test datafile=tempdata
      dbms=csv replace;
      datarow=2;
      getnames=yes;
   run;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Of course,&amp;nbsp;&amp;amp;filenm is a macro variable holding the full path filename of the file you are attempting to import.&lt;/P&gt;&lt;P&gt;"firstobs=10" allows me to skip those first 9 useless lines.&lt;/P&gt;&lt;P&gt;"filename tempdata temp" sets up a text file in the WORK folder that is output to in the "file tempdata dlm=',' lrecl=32760;" step of the "data _NULL_" block and then becomes the input of the PROC IMPORT block at the end.&lt;/P&gt;&lt;P&gt;The PROC IMPORT works as usual (DBMS=CSV for comma-delimited, DATAROW=2 to instruct IMPORT that the data starts on the 2nd line of the new/temporary file; GETNAMES=YES uses the column labels from the former 10th line - now top line - of the file).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope that covers everything.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2017 17:07:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/411594#M67357</guid>
      <dc:creator>SwingCorey</dc:creator>
      <dc:date>2017-11-08T17:07:41Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/439092#M69123</link>
      <description>&lt;P&gt;&lt;img id="robotwink" class="emoticon emoticon-robotwink" src="https://communities.sas.com/i/smilies/16x16_robot-wink.png" alt="Robot wink" title="Robot wink" /&gt;&lt;/P&gt;&lt;P&gt;You could also try to import the data and rename all the fields using the code below...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/*IMPORT THE CSV FILE*/&lt;BR /&gt;PROC IMPORT OUT= WORK.GET&lt;BR /&gt;DATAFILE= &amp;lt;YOUR FILE LOCATION HERE&amp;gt;&lt;BR /&gt;DBMS=CSV REPLACE;&lt;BR /&gt;GETNAMES=Yes;&lt;BR /&gt;GUESSINGROWS=300;&lt;BR /&gt;RUN;&lt;BR /&gt;/*TRANSPOSE TO RENAME VARIABLES*/&lt;BR /&gt;proc transpose data=GET(obs=1) out=temp;&lt;BR /&gt;var _all_;&lt;BR /&gt;run;&lt;BR /&gt;data temp (DROP = &amp;lt;SOME COLUMNS HERE&amp;gt;);&lt;BR /&gt;set temp;&lt;BR /&gt;format NEWNAME $20.;&lt;BR /&gt;NEWNAME = compress(COL1);&lt;BR /&gt;&amp;lt;YOURNAMING CONVENTION HERE&amp;gt;&lt;BR /&gt;run;&lt;BR /&gt;/*LOAD THE NEWNAMES INTO A MACRO VARIABLE*/&lt;BR /&gt;proc sql ;&lt;BR /&gt;select catx('=',_name_,NEWNAME)&lt;BR /&gt;into :rename separated by ' '&lt;BR /&gt;from temp;&lt;BR /&gt;quit;&lt;BR /&gt;/*RENAME VARIABLES WITH NEW NAME*/&lt;BR /&gt;data GET;&lt;BR /&gt;set GET(firstobs=2 rename=(&amp;amp;rename));&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 21:42:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/439092#M69123</guid>
      <dc:creator>mich1</dc:creator>
      <dc:date>2018-02-21T21:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: variable names in "row 2" how to let PROC IMPORT to start from the 2rd row?</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/511406#M73062</link>
      <description>&lt;P&gt;We can use 'Range' to import specific row/columns from the input file.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;import&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="3"&gt;out&lt;/FONT&gt; &lt;FONT face="helvetica"&gt;&lt;EM&gt;= &lt;FONT face="Courier New" size="3"&gt;work.input_file datafile=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;'c:\temp\class.xlsx'&lt;/FONT&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;dbms&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=xlsx &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;replace&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;range&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=&lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="3"&gt;"'Data - Groups'$A7 : O12"&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="3"&gt;GETNAMES&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;=YES;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="3"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica"&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="helvetica"&gt;&lt;EM&gt;Thanks&lt;/EM&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Nov 2018 15:31:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/variable-names-in-quot-row-2-quot-how-to-let-PROC-IMPORT-to/m-p/511406#M73062</guid>
      <dc:creator>VioSas</dc:creator>
      <dc:date>2018-11-08T15:31:13Z</dc:date>
    </item>
  </channel>
</rss>

