<?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: Input cvs file with infile and @ n pointer to format variables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Input-cvs-file-with-infile-and-n-pointer-to-format-variables/m-p/360302#M84795</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;It worked out except resulting missing in variable "subj"? strange?&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8977i5C14AAD47D37F132/image-size/original?v=1.0&amp;amp;px=-1" alt="error.png" title="error.png" border="0" /&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 21 May 2017 12:09:09 GMT</pubDate>
    <dc:creator>Cruise</dc:creator>
    <dc:date>2017-05-21T12:09:09Z</dc:date>
    <item>
      <title>Input cvs file with infile and @ n pointer to format variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-cvs-file-with-infile-and-n-pointer-to-format-variables/m-p/360275#M84784</link>
      <description>&lt;P&gt;Any idea where I'm making mistake here?&lt;/P&gt;&lt;P&gt;See first obs of data attached to this post.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA want;
  infile 'C:\Users\Maggie\Desktop\data' delimiter=',';
  input @1 time 1.
        @3 group 1.
		@5 subj 4.
		@10(GH1 PF01-PF10 RP1-RP4 RE1-RE3 SF1
             BP1-BP2 VT1 MH1 MH2 MH3 VT2 MH4 VT3 MH5
             VT4 SF2 GH2 GH3 GH4 GH5) (1.); &lt;BR /&gt;run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Any hints are appreciated.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sun, 21 May 2017 05:09:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-cvs-file-with-infile-and-n-pointer-to-format-variables/m-p/360275#M84784</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2017-05-21T05:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: Input cvs file with infile and @ n pointer to format variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-cvs-file-with-infile-and-n-pointer-to-format-variables/m-p/360277#M84785</link>
      <description>&lt;P&gt;What about:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA want;
  infile 'c:\temp\data.csv' delimiter=',' dsd truncover firstobs=2;
  input 
    ( 
      Time Group Subj GH1 PF01 PF02 PF03 PF04 PF05 PF06 PF07 PF08 
      PF09 PF10 RP1 RP2 RP3 RP4 RE1 RE2 RE3 SF1 BP1 BP2 VT1 MH1 MH2 
      MH3 VT2 MH4 VT3 MH5 VT4 SF2 GH2 GH3 GH4 GH5 
    )
    (:best32.)
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 21 May 2017 05:33:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-cvs-file-with-infile-and-n-pointer-to-format-variables/m-p/360277#M84785</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-05-21T05:33:08Z</dc:date>
    </item>
    <item>
      <title>Re: Input cvs file with infile and @ n pointer to format variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-cvs-file-with-infile-and-n-pointer-to-format-variables/m-p/360278#M84786</link>
      <description>&lt;PRE class=" language-sas"&gt;&lt;CODE class="  language-sas"&gt; &lt;SPAN class="token statement"&gt;infile&lt;/SPAN&gt; &lt;SPAN class="token string"&gt;'C:\Users\Maggie\Desktop\data.csv'&lt;/SPAN&gt; &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;You dint add the file extension &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 May 2017 05:34:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-cvs-file-with-infile-and-n-pointer-to-format-variables/m-p/360278#M84786</guid>
      <dc:creator>gauthamk28</dc:creator>
      <dc:date>2017-05-21T05:34:36Z</dc:date>
    </item>
    <item>
      <title>Re: Input cvs file with infile and @ n pointer to format variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-cvs-file-with-infile-and-n-pointer-to-format-variables/m-p/360281#M84788</link>
      <description>&lt;P&gt;You do not need positions when you have a delimited file, SAS finds the columns through the delimiters on its own.&lt;/P&gt;
&lt;P&gt;Since all variables are numbers, also drop the informats from the input.&lt;/P&gt;
&lt;P&gt;And also add firstobs=2 to the infile statement so you skip the header line.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When reading a delimited file&amp;nbsp;&lt;U&gt;with&lt;/U&gt; formats, add a colon before the format to prevent pure formatted input that disregards the delimiters.&lt;/P&gt;</description>
      <pubDate>Sun, 21 May 2017 06:42:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-cvs-file-with-infile-and-n-pointer-to-format-variables/m-p/360281#M84788</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2017-05-21T06:42:25Z</dc:date>
    </item>
    <item>
      <title>Re: Input cvs file with infile and @ n pointer to format variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-cvs-file-with-infile-and-n-pointer-to-format-variables/m-p/360302#M84795</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/12447"&gt;@Patrick&lt;/a&gt;It worked out except resulting missing in variable "subj"? strange?&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://communities.sas.com/t5/image/serverpage/image-id/8977i5C14AAD47D37F132/image-size/original?v=1.0&amp;amp;px=-1" alt="error.png" title="error.png" border="0" /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 21 May 2017 12:09:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-cvs-file-with-infile-and-n-pointer-to-format-variables/m-p/360302#M84795</guid>
      <dc:creator>Cruise</dc:creator>
      <dc:date>2017-05-21T12:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: Input cvs file with infile and @ n pointer to format variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-cvs-file-with-infile-and-n-pointer-to-format-variables/m-p/360317#M84806</link>
      <description>&lt;P&gt;If you have a delimited file then use the DSD option and do not use column pointers or formatted input.&lt;/P&gt;
&lt;P&gt;Your file is simple since all of the variables appear to be numbers.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  infile "&amp;amp;path/data.csv" dsd dlm=',' firstobs=2 truncover ;
  input Time Group Subj  GH1 PF01-PF10 RP1-RP4 
        RE1-RE3 SF1 BP1 BP2 VT1 MH1-MH3 VT2 MH4 VT3 MH5 VT4 SF2 GH2-GH5
  ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If your file is more complex, for example with some character variables then you would want to first define the variables using a LENGTH statement before the INPUT statement.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 May 2017 16:33:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-cvs-file-with-infile-and-n-pointer-to-format-variables/m-p/360317#M84806</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-05-21T16:33:19Z</dc:date>
    </item>
    <item>
      <title>Re: Input cvs file with infile and @ n pointer to format variables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Input-cvs-file-with-infile-and-n-pointer-to-format-variables/m-p/360320#M84808</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/132289"&gt;@Cruise&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;You're dealing with a simple comma separated list. Use list input and do not use any pointer control (&lt;EM&gt;the @&lt;/EM&gt;) as this messes up things for you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lestmtsref/69738/HTML/default/viewer.htm#n0lrz3gb7m9e4rn137op544ddg0v.htm&amp;nbsp;" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lestmtsref/69738/HTML/default/viewer.htm#n0lrz3gb7m9e4rn137op544ddg0v.htm&amp;nbsp;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Look into: &lt;EM&gt;Example 4: Reading Comma-Delimited Data with List Input and an Informat&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;BTW: If you would start using SAS Studio or SAS EG then you could take advantage of import wizards which help you to generate the correct SAS code.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 21 May 2017 17:32:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Input-cvs-file-with-infile-and-n-pointer-to-format-variables/m-p/360320#M84808</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2017-05-21T17:32:14Z</dc:date>
    </item>
  </channel>
</rss>

