<?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: SAS-novice questions: in which community to post? in All Things Community</title>
    <link>https://communities.sas.com/t5/All-Things-Community/SAS-novice-questions-in-which-community-to-post/m-p/244072#M1323</link>
    <description>&lt;P&gt;Thanks for the answer (it works) and the tips.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I have SAS 9.3, apparently dat is Base SAS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still have to find out why your solution works (_n_).&lt;/P&gt;</description>
    <pubDate>Sun, 17 Jan 2016 20:07:19 GMT</pubDate>
    <dc:creator>WilTamis</dc:creator>
    <dc:date>2016-01-17T20:07:19Z</dc:date>
    <item>
      <title>SAS-novice questions: in which community to post?</title>
      <link>https://communities.sas.com/t5/All-Things-Community/SAS-novice-questions-in-which-community-to-post/m-p/244015#M1321</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am a SAS-novice, and working through the book of Andy Field and Jeremy Miles "Discovering statistics using SAS".&lt;/P&gt;&lt;P&gt;I am encountering all kind of smaller hiccups doing the exercises in the book, what has to do with the SAS-program (and not with the statistics itself).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the proper platform/community for my questions. I will give one example.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One of the datafiles to be used for the exercises misses for some unknown reason a vairiable ID. I now want to create a variable (vector) ID with 50 records from 1 to 50, and to add that to the datafile. Of course I can add the data manually, but I want to learn to write some simple code. In R this is no problem for me. But is SAS I ran into troubles.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I created a vector V as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC IML;&lt;/P&gt;&lt;P&gt;V=T(1:50);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then aI tried to add that to the dataset&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA set2; SET set1;&lt;/P&gt;&lt;P&gt;ID=V;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then in set2 two new empty variables have been created ID and V.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Wil Tamis&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jan 2016 20:43:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/SAS-novice-questions-in-which-community-to-post/m-p/244015#M1321</guid>
      <dc:creator>WilTamis</dc:creator>
      <dc:date>2016-01-16T20:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: SAS-novice questions: in which community to post?</title>
      <link>https://communities.sas.com/t5/All-Things-Community/SAS-novice-questions-in-which-community-to-post/m-p/244041#M1322</link>
      <description>&lt;P&gt;Most of your questions can be posted under SAS Programming &amp;gt;Base SAS Programming.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Proc IML is not part of Base SAS. You can mix and go between data steps and Proc IML, but if you're new it might not be the best idea.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IML treats data like R, arrays/matrices and column functions. Base SAS does not, it goes through data line by line.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That being said, if you want to add a row identifier of 1 to 50 to your data set you can use the automatic variable _n_. I'm not sure what you're trying to do with the 1 to 50 so this may or may not make sense. A great way to ask questions is to show the current structure/sample of your data and your desired output.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;DATA set2; 
SET set1;
ID=_n_;
RUN;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 17 Jan 2016 03:38:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/SAS-novice-questions-in-which-community-to-post/m-p/244041#M1322</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-17T03:38:49Z</dc:date>
    </item>
    <item>
      <title>Re: SAS-novice questions: in which community to post?</title>
      <link>https://communities.sas.com/t5/All-Things-Community/SAS-novice-questions-in-which-community-to-post/m-p/244072#M1323</link>
      <description>&lt;P&gt;Thanks for the answer (it works) and the tips.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, I have SAS 9.3, apparently dat is Base SAS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Still have to find out why your solution works (_n_).&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jan 2016 20:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/SAS-novice-questions-in-which-community-to-post/m-p/244072#M1323</guid>
      <dc:creator>WilTamis</dc:creator>
      <dc:date>2016-01-17T20:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: SAS-novice questions: in which community to post?</title>
      <link>https://communities.sas.com/t5/All-Things-Community/SAS-novice-questions-in-which-community-to-post/m-p/244074#M1324</link>
      <description>&lt;P&gt;_n_ is an automatic variable, that iterates at the end of each data step iteration.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It's not a row counter, but can be used as a row counter unless you're doing some complex data steps.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It sounds like you have Base SAS, not EG (point and click interface) or SAS Studio (accessed via web browswer).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/forums/replypage/board-id/community_discussion/message-id/1323" target="_blank"&gt;https://communities.sas.com/t5/forums/replypage/board-id/community_discussion/message-id/1323&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you're new to SAS, the SAS Analytics U page has training resources, free and paid, on the link on the right hand side. The first SAS programming e-course is free.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jan 2016 20:13:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/SAS-novice-questions-in-which-community-to-post/m-p/244074#M1324</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-01-17T20:13:32Z</dc:date>
    </item>
  </channel>
</rss>

