<?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 @ in data in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SAS-in-data/m-p/111294#M30832</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You mean&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;until (num eq .)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 15 Aug 2013 00:52:23 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2013-08-15T00:52:23Z</dc:date>
    <item>
      <title>SAS @ in data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-in-data/m-p/111291#M30829</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, I am trying to figure out two things from the code below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Using @ after num in the input holds num or id when reading the rest of line.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2 Why I get different results when I use input num @ after the do while than if I use input num. I get expected results when using @ but still would be helpful if someone could tell why can not I avoid using @.&lt;/P&gt;&lt;P&gt;Data test;&lt;BR /&gt;infile datalines Missover;&lt;BR /&gt;input id num @; /*this holds the current num record*/&lt;BR /&gt;nump = 0; /*initiate nump*/&lt;BR /&gt; do while (num ne .);&lt;BR /&gt;&amp;nbsp; nump + 1 ; /* increment nump by 1 if num is ne .*/&lt;BR /&gt;&amp;nbsp; output;&lt;BR /&gt;input num @;&lt;BR /&gt;end;&lt;BR /&gt;datalines;&lt;BR /&gt;100 1 2 3&lt;BR /&gt;101 4 5 &lt;BR /&gt;102 6 7 8 9 10&lt;BR /&gt;;&lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 19:16:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-in-data/m-p/111291#M30829</guid>
      <dc:creator>Siddharth123</dc:creator>
      <dc:date>2013-08-14T19:16:39Z</dc:date>
    </item>
    <item>
      <title>Re: SAS @ in data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-in-data/m-p/111292#M30830</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;With the @ in the loop, you are always reading from the same line. But without the @, the first time you go through the loop, you are reading the same line as the first input statement because it ended by @. The second time you execute the loop, in the absence of a trailling @ you are reading the &lt;SPAN style="text-decoration: underline;"&gt;next&lt;/SPAN&gt; line, because the last input statement didn't end with a @.&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;hth&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 19:57:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-in-data/m-p/111292#M30830</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-08-14T19:57:34Z</dc:date>
    </item>
    <item>
      <title>Re: SAS @ in data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-in-data/m-p/111293#M30831</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need the @ to continue to read from the same line.&lt;/P&gt;&lt;P&gt;Note that in general you should use TRUNCOVER instead of MISSOVER, but since you are using list mode input it will not matter in this program.&lt;/P&gt;&lt;P&gt;What happens when there are no values for NUM?&amp;nbsp; Your program will not output any observation for such a line.&amp;nbsp; You might want to change from WHILE () to UNTIL () so that you will get one observation with NUM=. .&lt;/P&gt;&lt;P&gt;You can have the DO loop do the counting for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; background-color: #ffffff;"&gt;do nump=1 by 1 until (num ne .);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&lt;SPAN style="background-color: #ffffff;"&gt; &lt;/SPAN&gt;&lt;SPAN style="background-color: #ffffff;"&gt;&amp;nbsp; output;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; background-color: #ffffff;"&gt;&amp;nbsp; input num @;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier; background-color: #ffffff;"&gt;end;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Aug 2013 23:35:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-in-data/m-p/111293#M30831</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-08-14T23:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: SAS @ in data</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SAS-in-data/m-p/111294#M30832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You mean&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;until (num eq .)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Aug 2013 00:52:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SAS-in-data/m-p/111294#M30832</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2013-08-15T00:52:23Z</dc:date>
    </item>
  </channel>
</rss>

