<?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 character value with dash in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/input-character-value-with-dash/m-p/572165#M161458</link>
    <description>&lt;P&gt;In line data stops on the line BEFORE the line with a semi-colon. So you are not passing any data to the data step.&lt;/P&gt;
&lt;P&gt;Remove the semi-colon from the line of data.&amp;nbsp; Or if the data actually contains semi-colons then use the DATALINES4 (aka CARDS4) statement and use a line with 4 semi-colons to end the data.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data out;
  input id $ description ~$ message ~$ num error ~$;
datalines;
ACN-1-001  "BLABLA" "BLABLA" 4 "BLABLA"
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or if the data actually contains semi-colons then use the DATALINES4 (aka CARDS4) statement and use a line with 4 semi-colons to end the data.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data out;
  input id $ description ~$ message ~$ num error ~$;
datalines4;
ACN-1-001  "BLABLA" "BLABLA" 4 "BLABLA"
;;;;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also if you don't want the quotes as part of the value then don't use the ~ (tilda) modifier on the INPUT statement.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jul 2019 17:41:08 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-07-09T17:41:08Z</dc:date>
    <item>
      <title>input character value with dash</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-character-value-with-dash/m-p/572162#M161455</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;This is a really silly question...&lt;/P&gt;&lt;P&gt;I want to create a data set where one of its column value contains dash in the string.&amp;nbsp;&lt;/P&gt;&lt;P&gt;here's my code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data out;&lt;/P&gt;&lt;P&gt;input id $ description ~$ message ~$ num error ~$;&lt;/P&gt;&lt;P&gt;datalines;&lt;/P&gt;&lt;P&gt;ACN-1-001&amp;nbsp; "BLABLA" "BLABLA" 4 "BLABLA";&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;what i want:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;id&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;description&amp;nbsp; &amp;nbsp; &amp;nbsp;message&amp;nbsp; &amp;nbsp; &amp;nbsp; num&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;error&lt;/P&gt;&lt;P&gt;ACN-1-001&amp;nbsp; &amp;nbsp; BLABLA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BLABLA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;4&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BLABLA&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;there's an error message: statement is not valid or it is used out of proper order. I think the id input might need a special format but I don't know which one I should use.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 17:33:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-character-value-with-dash/m-p/572162#M161455</guid>
      <dc:creator>laiguanyu001</dc:creator>
      <dc:date>2019-07-09T17:33:25Z</dc:date>
    </item>
    <item>
      <title>Re: input character value with dash</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-character-value-with-dash/m-p/572165#M161458</link>
      <description>&lt;P&gt;In line data stops on the line BEFORE the line with a semi-colon. So you are not passing any data to the data step.&lt;/P&gt;
&lt;P&gt;Remove the semi-colon from the line of data.&amp;nbsp; Or if the data actually contains semi-colons then use the DATALINES4 (aka CARDS4) statement and use a line with 4 semi-colons to end the data.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data out;
  input id $ description ~$ message ~$ num error ~$;
datalines;
ACN-1-001  "BLABLA" "BLABLA" 4 "BLABLA"
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or if the data actually contains semi-colons then use the DATALINES4 (aka CARDS4) statement and use a line with 4 semi-colons to end the data.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data out;
  input id $ description ~$ message ~$ num error ~$;
datalines4;
ACN-1-001  "BLABLA" "BLABLA" 4 "BLABLA"
;;;;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also if you don't want the quotes as part of the value then don't use the ~ (tilda) modifier on the INPUT statement.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 17:41:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-character-value-with-dash/m-p/572165#M161458</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-09T17:41:08Z</dc:date>
    </item>
    <item>
      <title>Re: input character value with dash</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-character-value-with-dash/m-p/572170#M161459</link>
      <description>&lt;P&gt;Hi thanks! That solves the problem. I kept the ~$ because I am inputting&amp;nbsp; sentences for description and message. There are lots of space in each sentence so I thought it'd be a good idea to quote around them? Is this a good idea or do you have other suggestions?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 17:49:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-character-value-with-dash/m-p/572170#M161459</guid>
      <dc:creator>laiguanyu001</dc:creator>
      <dc:date>2019-07-09T17:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: input character value with dash</title>
      <link>https://communities.sas.com/t5/SAS-Programming/input-character-value-with-dash/m-p/572175#M161460</link>
      <description>&lt;P&gt;If the values contain spaces then use a delimiter.&lt;/P&gt;
&lt;P&gt;Something like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data out;
  infile datalines dsd dlm='|' truncover;
  input id :$20. description :$40. message :$200. num error :$200.;
datalines;
ACN-1-001|BLA BLA|BLA BLA|4|BLA BLA
;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the value actually contains the delimiter then add quotes around it (&amp;nbsp; "BLA|BLA" ). The quotes will not become part of the value stored in the variable.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 18:09:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/input-character-value-with-dash/m-p/572175#M161460</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-07-09T18:09:24Z</dc:date>
    </item>
  </channel>
</rss>

