<?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: about the @ after input statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/about-the-after-input-statement/m-p/743085#M232564</link>
    <description>&lt;P&gt;This&amp;nbsp; is what I need . Thank you so much.&lt;/P&gt;</description>
    <pubDate>Fri, 21 May 2021 23:52:49 GMT</pubDate>
    <dc:creator>tianerhu</dc:creator>
    <dc:date>2021-05-21T23:52:49Z</dc:date>
    <item>
      <title>about the @ after input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/about-the-after-input-statement/m-p/743058#M232548</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Females;
   
   input @14 Gender $1. @;
   
   if Gender ne 'F' then delete;
   input @1 Subj $3.
         @4 DOB mmddyy10.
         @15 Balance 7.;
datalines;
00110/21/1955M   1145
00211/18/2001F  18722
00305/07/1944M 123.45
00407/25/1945F -12345
;

proc print data = Females;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tianerhu_0-1621632043058.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/59676iA1AFFFF7A5FD4218/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tianerhu_0-1621632043058.png" alt="tianerhu_0-1621632043058.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;when I remove&amp;nbsp;@ after input statement(input&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189370"&gt;@14&lt;/a&gt; Gender $1 @), the output as above , why&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 21:23:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/about-the-after-input-statement/m-p/743058#M232548</guid>
      <dc:creator>tianerhu</dc:creator>
      <dc:date>2021-05-21T21:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: about the @ after input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/about-the-after-input-statement/m-p/743061#M232551</link>
      <description>&lt;P&gt;&amp;nbsp;I think that if remove @, SAS go through step by step as following:&lt;/P&gt;
&lt;P&gt;1: input &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/189370"&gt;@14&lt;/a&gt; Gender $1 —— get M&lt;/P&gt;
&lt;P&gt;2: judge the value ——M， and delete the first row (001 01/21/1955 M 1145)&lt;/P&gt;
&lt;P&gt;3: now the pointer at the second row (because remove @)&lt;/P&gt;
&lt;P&gt;4：the code (input @1 Subj $3&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @4&amp;nbsp; DOB mmddyy10.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; @15 Balance 7.; )&amp;nbsp; read the data in the second row ；&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where is wrong?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 21:33:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/about-the-after-input-statement/m-p/743061#M232551</guid>
      <dc:creator>tianerhu</dc:creator>
      <dc:date>2021-05-21T21:33:56Z</dc:date>
    </item>
    <item>
      <title>Re: about the @ after input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/about-the-after-input-statement/m-p/743065#M232554</link>
      <description>&lt;P&gt;I am not sure what you mean by "is wrong".&lt;/P&gt;
&lt;P&gt;The first example the @ at the end of the first Input statement holds the input pointer after the the value for Gender is read.&lt;/P&gt;
&lt;P&gt;You might try running this version of the code:&lt;/P&gt;
&lt;PRE&gt;data Females;
   input @14 Gender $1.;
   put 'After first input ' _all_;
   
   if Gender ne 'F' then delete;
   put 'After delete ' _all_;
   input @1 Subj $3.
         @4 DOB mmddyy10.
         @15 Balance 7.;
   put 'After second Input ' _all_;
datalines;
00110/21/1955M   1145
00211/18/2001F  18722
00305/07/1944M 123.45
00407/25/1945F -12345
;&lt;/PRE&gt;
&lt;P&gt;Which generates these lines in the log:&lt;/P&gt;
&lt;PRE&gt;After first input Gender=M Subj=  DOB=. Balance=. _ERROR_=0 _N_=1
After first input Gender=F Subj=  DOB=. Balance=. _ERROR_=0 _N_=2
After delete Gender=F Subj=  DOB=. Balance=. _ERROR_=0 _N_=2
After second Input Gender=F &lt;FONT color="#000080"&gt;&lt;STRONG&gt;Subj=003 DOB=-5717&lt;/STRONG&gt; &lt;/FONT&gt;Balance=123.45 _ERROR_=0 _N_=2
After first input Gender=F Subj=  DOB=. Balance=. _ERROR_=0 _N_=3
After delete Gender=F Subj=  DOB=. Balance=. _ERROR_=0 _N_=3
NOTE: LOST CARD.
RULE:      ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+--
771        ;
Gender=F Subj=  DOB=. Balance=. _ERROR_=1 _N_=3

&lt;/PRE&gt;
&lt;P&gt;Two pieces that are pretty important note that the Subj=003 I highlighted? That is because before the data was written the second INPUT executed and read from the next line (the third) because the second data line was discarded as already ready after the first input. And after that Input the read buffer presents the 4th line of data to be read which is what the First input sees. After reading the F in the 4th line it again discards the current line and prepares to read the next with second Input statement. But that is attempting to read past the end of the data&lt;/P&gt;
&lt;P&gt;There is only ONE output record because the attempt to read past the end of the data causes an error.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You did see that "lost card" in your log didn't you?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The _n_ in the log is the iteration of the data step&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 22:09:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/about-the-after-input-statement/m-p/743065#M232554</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-05-21T22:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: about the @ after input statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/about-the-after-input-statement/m-p/743085#M232564</link>
      <description>&lt;P&gt;This&amp;nbsp; is what I need . Thank you so much.&lt;/P&gt;</description>
      <pubDate>Fri, 21 May 2021 23:52:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/about-the-after-input-statement/m-p/743085#M232564</guid>
      <dc:creator>tianerhu</dc:creator>
      <dc:date>2021-05-21T23:52:49Z</dc:date>
    </item>
  </channel>
</rss>

