<?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 am I lacking in understanding?  simple Data Step problem.. in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/What-am-I-lacking-in-understanding-simple-Data-Step-problem/m-p/544654#M7900</link>
    <description>&lt;P&gt;Once you have created the data set named SCHOOL, to use it in another data step, you use SET.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to read data from a text (or csv or similar) file, then you use INFILE.&lt;/P&gt;</description>
    <pubDate>Wed, 20 Mar 2019 17:13:53 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2019-03-20T17:13:53Z</dc:date>
    <item>
      <title>What am I lacking in understanding?  simple Data Step problem..</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-am-I-lacking-in-understanding-simple-Data-Step-problem/m-p/544648#M7899</link>
      <description>&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data school;&lt;BR /&gt;input age quiz : $1. midterm final;&lt;BR /&gt;datalines;&lt;BR /&gt;12 A 92 95&lt;BR /&gt;12 B 88 88&lt;BR /&gt;13 C 78 75&lt;BR /&gt;13 A 92 93&lt;BR /&gt;12 F 55 62&lt;BR /&gt;12 B 88 82&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;data newschool;&lt;BR /&gt;infile school;&lt;BR /&gt;input age quiz : $1 midterm final;&lt;BR /&gt;if age = 12 then grade = 6;&lt;BR /&gt;else if age =13 then grade = 8;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The error I get is:&lt;/P&gt;&lt;PRE class="sasLog"&gt;ERROR: No logical assign for filename SCHOOL.&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't really understand the difference between 'set' and 'infile'.&amp;nbsp; It seems I have a fundamental misunderstanding of what is going on, so I'd like to clear it up.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 17:07:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-am-I-lacking-in-understanding-simple-Data-Step-problem/m-p/544648#M7899</guid>
      <dc:creator>TimmySauce</dc:creator>
      <dc:date>2019-03-20T17:07:25Z</dc:date>
    </item>
    <item>
      <title>Re: What am I lacking in understanding?  simple Data Step problem..</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-am-I-lacking-in-understanding-simple-Data-Step-problem/m-p/544654#M7900</link>
      <description>&lt;P&gt;Once you have created the data set named SCHOOL, to use it in another data step, you use SET.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to read data from a text (or csv or similar) file, then you use INFILE.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 17:13:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-am-I-lacking-in-understanding-simple-Data-Step-problem/m-p/544654#M7900</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-03-20T17:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: What am I lacking in understanding?  simple Data Step problem..</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-am-I-lacking-in-understanding-simple-Data-Step-problem/m-p/544659#M7901</link>
      <description>&lt;P&gt;So, I changed 'infile' to 'set' and got this error:&lt;/P&gt;&lt;PRE class="sasLog"&gt;No DATALINES or INFILE statement&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data school;&lt;BR /&gt;input age quiz : $1. midterm final;&lt;BR /&gt;if age = 12 then grade = 6;&lt;BR /&gt;else if age =13 then grade = 8;&lt;BR /&gt;datalines;&lt;BR /&gt;12 A 92 95&lt;BR /&gt;12 B 88 88&lt;BR /&gt;13 C 78 75&lt;BR /&gt;13 A 92 93&lt;BR /&gt;12 F 55 62&lt;BR /&gt;12 B 88 82&lt;BR /&gt;;&lt;BR /&gt;RUN;&lt;/P&gt;&lt;P&gt;data newschool;&lt;BR /&gt;set school;&lt;BR /&gt;input age quiz : $1 midterm final;&lt;BR /&gt;if age = 12 then grade = 6;&lt;BR /&gt;else if age =13 then grade = 8;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 17:41:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-am-I-lacking-in-understanding-simple-Data-Step-problem/m-p/544659#M7901</guid>
      <dc:creator>TimmySauce</dc:creator>
      <dc:date>2019-03-20T17:41:27Z</dc:date>
    </item>
    <item>
      <title>Re: What am I lacking in understanding?  simple Data Step problem..</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-am-I-lacking-in-understanding-simple-Data-Step-problem/m-p/544660#M7902</link>
      <description>This isn't what you asked, but it's something you need to know.  You don't need two DATA steps.  You can move the IF THEN logic to just before the DATALINES statement in your first DATA step.</description>
      <pubDate>Wed, 20 Mar 2019 17:47:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-am-I-lacking-in-understanding-simple-Data-Step-problem/m-p/544660#M7902</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2019-03-20T17:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: What am I lacking in understanding?  simple Data Step problem..</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-am-I-lacking-in-understanding-simple-Data-Step-problem/m-p/544661#M7903</link>
      <description>Hi, When you use a SET Statement, the INPUT statement is not required. All the variables you created in the first program are all available to you in the second program just based on the SET statement. This is one of the benefits of using a SET statement -- you do not have to "redefine" or "re-read" the variables.&lt;BR /&gt;Cynthia</description>
      <pubDate>Wed, 20 Mar 2019 17:47:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-am-I-lacking-in-understanding-simple-Data-Step-problem/m-p/544661#M7903</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-03-20T17:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: What am I lacking in understanding?  simple Data Step problem..</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-am-I-lacking-in-understanding-simple-Data-Step-problem/m-p/544662#M7904</link>
      <description>&lt;P&gt;When you use SET, you usually won't also do an INPUT. You already did the INPUT for data set SCHOOL when it was created, so you don't need another INPUT to use data set SCHOOL.&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 18:04:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-am-I-lacking-in-understanding-simple-Data-Step-problem/m-p/544662#M7904</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-03-20T18:04:32Z</dc:date>
    </item>
    <item>
      <title>Re: What am I lacking in understanding?  simple Data Step problem..</title>
      <link>https://communities.sas.com/t5/New-SAS-User/What-am-I-lacking-in-understanding-simple-Data-Step-problem/m-p/544704#M7912</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;This isn't what you asked, but it's something you need to know. You don't need two DATA steps. You can move the IF THEN logic to just before the DATALINES statement in your first DATA step.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Having seen code where people created a dozen or so data sets each adding a single variable (and then getting lost later as to which set to use) I heartily agree with this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Mar 2019 21:09:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/What-am-I-lacking-in-understanding-simple-Data-Step-problem/m-p/544704#M7912</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-03-20T21:09:32Z</dc:date>
    </item>
  </channel>
</rss>

