<?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: Defining Variables for first time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Defining-Variables-for-first-time/m-p/749040#M235324</link>
    <description>&lt;P&gt;SAS doesn't know the variable names you want to use unless you tell it.&amp;nbsp; But if there is a pattern to the variable names, you can define them on the INPUT statement.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input @21 (q1-q20) (2. 1.);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This defines 20 variables, the odd-numbered variables being read from 2 characters of the input data line, and the even-numbered variables being read from 1 character.&amp;nbsp; So Q1 comes from columns 21-22, Q2 from column 23, Q3 from columns 24-25 etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While there are many variations possible on this theme, you would need to spell out some detail.&amp;nbsp; For a more specific answer we would need to know about what the variable names are, as well as where they appear on the raw data line.&amp;nbsp; It might help to know whether you have an electronic list of the variable names, and what that list looks like (such as how wide they are and whether they are character or numeric).&amp;nbsp; If you have this information, there are a variety of ways available to provide that information to a SAS program.&amp;nbsp; But if you don't have it, there's no way for SAS to know.&lt;/P&gt;</description>
    <pubDate>Sat, 19 Jun 2021 17:39:10 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2021-06-19T17:39:10Z</dc:date>
    <item>
      <title>Defining Variables for first time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Defining-Variables-for-first-time/m-p/749027#M235320</link>
      <description>&lt;P&gt;So if you have many variables, how can you define them without having to write out each one in the input statement? I know that once you have them defined initially you can use variable lists and there are many other options like using _ALL_ , _NUMERIC_ etc, but how about initially. Do you have to type out 20 different variables?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jun 2021 13:46:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Defining-Variables-for-first-time/m-p/749027#M235320</guid>
      <dc:creator>edasdfasdfasdfa</dc:creator>
      <dc:date>2021-06-19T13:46:44Z</dc:date>
    </item>
    <item>
      <title>Re: Defining Variables for first time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Defining-Variables-for-first-time/m-p/749029#M235321</link>
      <description>&lt;P&gt;You might find this discussion useful:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/td-p/582197" target="_blank"&gt;https://communities.sas.com/t5/SAS-Programming/Assigning-Multiple-Variables/td-p/582197&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jun 2021 14:02:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Defining-Variables-for-first-time/m-p/749029#M235321</guid>
      <dc:creator>Norman21</dc:creator>
      <dc:date>2021-06-19T14:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Defining Variables for first time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Defining-Variables-for-first-time/m-p/749040#M235324</link>
      <description>&lt;P&gt;SAS doesn't know the variable names you want to use unless you tell it.&amp;nbsp; But if there is a pattern to the variable names, you can define them on the INPUT statement.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;input @21 (q1-q20) (2. 1.);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This defines 20 variables, the odd-numbered variables being read from 2 characters of the input data line, and the even-numbered variables being read from 1 character.&amp;nbsp; So Q1 comes from columns 21-22, Q2 from column 23, Q3 from columns 24-25 etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;While there are many variations possible on this theme, you would need to spell out some detail.&amp;nbsp; For a more specific answer we would need to know about what the variable names are, as well as where they appear on the raw data line.&amp;nbsp; It might help to know whether you have an electronic list of the variable names, and what that list looks like (such as how wide they are and whether they are character or numeric).&amp;nbsp; If you have this information, there are a variety of ways available to provide that information to a SAS program.&amp;nbsp; But if you don't have it, there's no way for SAS to know.&lt;/P&gt;</description>
      <pubDate>Sat, 19 Jun 2021 17:39:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Defining-Variables-for-first-time/m-p/749040#M235324</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-06-19T17:39:10Z</dc:date>
    </item>
  </channel>
</rss>

