<?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: What is the syntax for writing out variables that include spaces? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-syntax-for-writing-out-variables-that-include-spaces/m-p/899592#M355565</link>
    <description>&lt;P&gt;You should put the description (or question text) into the LABEL attached to the variable instead of trying to use it as the NAME of the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How did you IMPORT the data?&amp;nbsp; Did you use PROC IMPORT?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you must use PROC IMPORT then make sure to set the VALIDVARNAME option to V7 before running the PROC IMPORT step so it will make valid SAS names for the variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have the data in a TEXT file, such as a CSV file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In that case READ the data with your own data step and you can can control the names of the variables, including attaching the descriptive labels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Oct 2023 02:03:41 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-10-23T02:03:41Z</dc:date>
    <item>
      <title>What is the syntax for writing out variables that include spaces?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-syntax-for-writing-out-variables-that-include-spaces/m-p/899587#M355562</link>
      <description>&lt;P&gt;I have a survey imported into SAS where the variables are the questions themselves (for example: "What is your age?")&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am just trying to get a idea of the contents of the dataset with functions like proc print but I'm not sure of the syntax.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How would I go writing those variables as in below?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=mydata;&lt;/P&gt;&lt;P&gt;var What is your age?; run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried with single and double quotation marks but no success yet.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 01:04:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-syntax-for-writing-out-variables-that-include-spaces/m-p/899587#M355562</guid>
      <dc:creator>darrendu300</dc:creator>
      <dc:date>2023-10-23T01:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: What is the syntax for writing out variables that include spaces?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-syntax-for-writing-out-variables-that-include-spaces/m-p/899588#M355563</link>
      <description>&lt;P&gt;SAS variable names are limited to 32 characters so ideally try to import your data with more suitable variable names that conform to SAS naming conventions.&lt;/P&gt;
&lt;P&gt;To use a variable with a non-conformant name you need to address it as a &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lepg/p0z9rbr2w2vtd1n1q8lty9b13iv3.htm" target="_self"&gt;SAS Name Literal:&lt;/A&gt;&amp;nbsp;'&amp;lt;name&amp;gt;'n&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc print data=mydata;
  var 'What is your age?'n; 
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 01:09:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-syntax-for-writing-out-variables-that-include-spaces/m-p/899588#M355563</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-10-23T01:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: What is the syntax for writing out variables that include spaces?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/What-is-the-syntax-for-writing-out-variables-that-include-spaces/m-p/899592#M355565</link>
      <description>&lt;P&gt;You should put the description (or question text) into the LABEL attached to the variable instead of trying to use it as the NAME of the variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How did you IMPORT the data?&amp;nbsp; Did you use PROC IMPORT?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you must use PROC IMPORT then make sure to set the VALIDVARNAME option to V7 before running the PROC IMPORT step so it will make valid SAS names for the variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do you have the data in a TEXT file, such as a CSV file?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In that case READ the data with your own data step and you can can control the names of the variables, including attaching the descriptive labels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 02:03:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/What-is-the-syntax-for-writing-out-variables-that-include-spaces/m-p/899592#M355565</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-10-23T02:03:41Z</dc:date>
    </item>
  </channel>
</rss>

