<?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: Single trailing @ in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Single-trailing-in-SAS/m-p/776481#M246974</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to the&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n0oaql83drile0n141pdacojq97s.htm" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;The trailing @ prevents the next INPUT statement from automatically releasing the current input record and reading the next record into the input buffer. It is useful when you need to read from a record multiple times.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the link to read more about&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n0oaql83drile0n141pdacojq97s.htm#p0w3hkircglkogn1eqp3l9rwetlu" target="_self"&gt;Using Line-Hold Specifiers&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n0oaql83drile0n141pdacojq97s.htm#n0m5e9ju0os2mtn1qcphxoy81k8b" target="_self"&gt;Example 3: Holding a Record in the Input Buffer.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
    <pubDate>Tue, 26 Oct 2021 13:41:33 GMT</pubDate>
    <dc:creator>Amir</dc:creator>
    <dc:date>2021-10-26T13:41:33Z</dc:date>
    <item>
      <title>Single trailing @ in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Single-trailing-in-SAS/m-p/776471#M246966</link>
      <description>&lt;P&gt;This might be a basic question, I know the definition is&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Single trailing is temporary, it is for the current iteration of the DATA step only.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;But what exactly does it do? Does it mean to move to the next line at the end of the DATA step automatically or what else does it tell SAS to do?&lt;/P&gt;
&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 13:19:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Single-trailing-in-SAS/m-p/776471#M246966</guid>
      <dc:creator>aabbccwyt</dc:creator>
      <dc:date>2021-10-26T13:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: Single trailing @ in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Single-trailing-in-SAS/m-p/776479#M246972</link>
      <description>&lt;P&gt;Yes, the line pointer is advanced with the next data step iteration, or an INPUT without a line hold.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 13:34:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Single-trailing-in-SAS/m-p/776479#M246972</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-10-26T13:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Single trailing @ in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Single-trailing-in-SAS/m-p/776480#M246973</link>
      <description>&lt;P&gt;You didn't provide any context, so let's assume you are talking about the INPUT statement.&lt;/P&gt;
&lt;P&gt;The trailing&amp;nbsp;@ on an INPUT statement means to hold the input text line and the column pointer into that line of where the next INPUT will start reading.&amp;nbsp; You do this so you can read more values from the line.&lt;/P&gt;
&lt;P&gt;For example you might want to first read the field that indicates the type of line and then depending on the type of line read different variables.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   infile 'mydata.txt' ;
   input type :$1. @ ;
   if type='A' then input id dob :date. ;
   else if type='B' then input age height weight ;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or you might have an unknown number of values on the line.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   infile 'myfile.txt' truncover ;
   length id col value 8 ;
   input id value @;
   do col=1 by 1 until(missing(value);
     output;
     input value @;
   end;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The text you quoting is talking about the difference between using that and what happens when you have a double&amp;nbsp;@ at the end of the INPUT statement.&amp;nbsp; When you use the double&amp;nbsp;@ it means that the line/pointer does not move when you start the next iteration of the data step.&amp;nbsp; You would use the&amp;nbsp;@@&amp;nbsp; when you want to read multiple observations from the same line.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   input id age @@;
cards;
1 10 2 20 3 14 4 15 
5 17 6 18
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 26 Oct 2021 13:36:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Single-trailing-in-SAS/m-p/776480#M246973</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-10-26T13:36:44Z</dc:date>
    </item>
    <item>
      <title>Re: Single trailing @ in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Single-trailing-in-SAS/m-p/776481#M246974</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;According to the&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n0oaql83drile0n141pdacojq97s.htm" target="_blank" rel="noopener"&gt;documentation&lt;/A&gt;:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;The trailing @ prevents the next INPUT statement from automatically releasing the current input record and reading the next record into the input buffer. It is useful when you need to read from a record multiple times.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can use the link to read more about&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n0oaql83drile0n141pdacojq97s.htm#p0w3hkircglkogn1eqp3l9rwetlu" target="_self"&gt;Using Line-Hold Specifiers&lt;/A&gt;&amp;nbsp;and&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lestmtsref/n0oaql83drile0n141pdacojq97s.htm#n0m5e9ju0os2mtn1qcphxoy81k8b" target="_self"&gt;Example 3: Holding a Record in the Input Buffer.&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Amir.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2021 13:41:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Single-trailing-in-SAS/m-p/776481#M246974</guid>
      <dc:creator>Amir</dc:creator>
      <dc:date>2021-10-26T13:41:33Z</dc:date>
    </item>
  </channel>
</rss>

