<?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: questions - input statement &amp; proc import in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/questions-input-statement-proc-import/m-p/168125#M32313</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Be happy it did that as the headernames are not valid sas-names.&amp;nbsp; This is one of the aspects of using proc import, guessing.&lt;/P&gt;&lt;P&gt;Spaces in a string with a datastep can be handled in many ways, as usual it depends on more contraints. Singel/multiple blanks other recognitions.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 01 Oct 2014 15:31:25 GMT</pubDate>
    <dc:creator>jakarman</dc:creator>
    <dc:date>2014-10-01T15:31:25Z</dc:date>
    <item>
      <title>questions - input statement &amp; proc import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/questions-input-statement-proc-import/m-p/168124#M32312</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1. How to read the space delimited strings as one variable in data step? Ideally I wish to create the table as below with one variable&amp;nbsp; instead of many. Since I've spaces between the strings I couldn't succeed with the data step. Once I created a dataset then I can easily remove the middle characters (m&amp;nbsp; r as per inputs below) via scan &amp;amp; compress function to proceed further for my analysis.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data A;&lt;/P&gt;&lt;P&gt;Input name$ ;&lt;/P&gt;&lt;P&gt;Datalines;&lt;/P&gt;&lt;P&gt;Ra m ku&lt;/P&gt;&lt;P&gt;Ch r is&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2. My external file has a header like c:name c:zip c:address. Once I import this .csv via proc import, sas dataset variables turn out to be&amp;nbsp; c_name c_zip c_address. i.e. ':' are converted into '_'. How to get rid of this behavior?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I ran all my SAS code in EG 5.1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks in advance for your inputs.&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;TABLE width="550px"&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2014 15:01:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/questions-input-statement-proc-import/m-p/168124#M32312</guid>
      <dc:creator>RamKumar</dc:creator>
      <dc:date>2014-10-01T15:01:37Z</dc:date>
    </item>
    <item>
      <title>Re: questions - input statement &amp; proc import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/questions-input-statement-proc-import/m-p/168125#M32313</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Be happy it did that as the headernames are not valid sas-names.&amp;nbsp; This is one of the aspects of using proc import, guessing.&lt;/P&gt;&lt;P&gt;Spaces in a string with a datastep can be handled in many ways, as usual it depends on more contraints. Singel/multiple blanks other recognitions.&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2014 15:31:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/questions-input-statement-proc-import/m-p/168125#M32313</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-10-01T15:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: questions - input statement &amp; proc import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/questions-input-statement-proc-import/m-p/168126#M32314</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;May I request you to supply the code to handle the spaces in strings for my requirement?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2014 17:40:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/questions-input-statement-proc-import/m-p/168126#M32314</guid>
      <dc:creator>RamKumar</dc:creator>
      <dc:date>2014-10-01T17:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: questions - input statement &amp; proc import</title>
      <link>https://communities.sas.com/t5/SAS-Programming/questions-input-statement-proc-import/m-p/168127#M32315</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;For the formats you have:&lt;/P&gt;&lt;P&gt;- $varying. &lt;A href="http://support.sas.com/documentation/cdl/en/leforinforref/64790/HTML/default/viewer.htm#n00h0tql17cempn1kwjdbjdktpr3.htm" title="http://support.sas.com/documentation/cdl/en/leforinforref/64790/HTML/default/viewer.htm#n00h0tql17cempn1kwjdbjdktpr3.htm"&gt;SAS(R) 9.4 Formats and Informats: Reference&lt;/A&gt; that is apllicable working through the record knowing the length at some moment,&lt;/P&gt;&lt;P&gt;For the input statement list&lt;/P&gt;&lt;P&gt;- &lt;A href="http://support.sas.com/documentation/cdl/en/leforinforref/64790/HTML/default/viewer.htm#n00h0tql17cempn1kwjdbjdktpr3.htm" title="http://support.sas.com/documentation/cdl/en/leforinforref/64790/HTML/default/viewer.htm#n00h0tql17cempn1kwjdbjdktpr3.htm"&gt;SAS(R) 9.4 Formats and Informats: Reference&lt;/A&gt; there are modifiers. : &amp;amp; ~&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &amp;amp; one space is embedded space going into the variable and than two spaces are the real separation&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; ~ allows quoted strings with space to be processed&lt;/P&gt;&lt;P&gt;For the infile statement you have &lt;A href="http://support.sas.com/documentation/cdl/en/lestmtsref/67407/HTML/default/viewer.htm#n1rill4udj0tfun1fvce3j401plo.htm" title="http://support.sas.com/documentation/cdl/en/lestmtsref/67407/HTML/default/viewer.htm#n1rill4udj0tfun1fvce3j401plo.htm"&gt;SAS(R) 9.4 Statements: Reference, Third Edition&lt;/A&gt;:&lt;/P&gt;&lt;P&gt;- length=variable is giving you the length of the read record.&lt;/P&gt;&lt;P&gt;- col=variable is giving the position of cursor the input statement is.&amp;nbsp; &lt;/P&gt;&lt;P&gt;- The automatic _INFILE_&amp;nbsp; variable is filled with the complete record. Available to count the words&amp;nbsp; &lt;/P&gt;&lt;P&gt;With combining some methods you can handle almost every data-structure as long it is logical defined is some known way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In you example I would prefer the &amp;amp; modifier as it just 1 variable at each dataline .&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 01 Oct 2014 18:25:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/questions-input-statement-proc-import/m-p/168127#M32315</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-10-01T18:25:08Z</dc:date>
    </item>
  </channel>
</rss>

