<?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: Meaning of set @ Memo = 'Aug 16' in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Meaning-of-set-Memo-Aug-16/m-p/459043#M116544</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/122200"&gt;@astha8882000&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I read this line of code somewhere, I understand that the variable 'Memo' is initialized&amp;nbsp; to the value 'Aug 16', what is the purpose of '@'?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Showing the entire code would be better since the '@' can play a number of different roles in reading data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, the user usually goes in and updates the date everyday. Instead of doing that, isn't turning that into a macro variable a better option?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let Memo = %sysfunc(today());&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Since on 2 May 2018 the macro variable Memo received the value with that call of 21305, likely not the optimal solution.&lt;/P&gt;
&lt;P&gt;You would have to use sufficient SAS functions to make&amp;nbsp;the macro variable appear&amp;nbsp;exactly as&amp;nbsp;the value&amp;nbsp;appears in your data set.&lt;/P&gt;
&lt;P&gt;This might get you started:&lt;/P&gt;
&lt;PRE&gt;Data _null_;
   str=catx(' ',put(today(),monname3.),day(today()));
   call symputx('memo',str);
run;&lt;/PRE&gt;
&lt;P&gt;but may need tweeking if the day part of your search string should be Aug 01 instead of Aug 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't forget to use "&amp;amp;memo." for the string to resolve properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that I find a data set that has to be read this way if only one variable uses it to be very problematic&lt;/P&gt;</description>
    <pubDate>Tue, 01 May 2018 18:06:07 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-05-01T18:06:07Z</dc:date>
    <item>
      <title>Meaning of set @ Memo = 'Aug 16'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Meaning-of-set-Memo-Aug-16/m-p/459026#M116537</link>
      <description>&lt;P&gt;I read this line of code somewhere, I understand that the variable 'Memo' is initialized&amp;nbsp; to the value 'Aug 16', what is the purpose of '@'?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, the user usually goes in and updates the date everyday. Instead of doing that, isn't turning that into a macro variable a better option?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let Memo = %sysfunc(today());&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 16:19:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Meaning-of-set-Memo-Aug-16/m-p/459026#M116537</guid>
      <dc:creator>astha8882000</dc:creator>
      <dc:date>2018-05-01T16:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Meaning of set @ Memo = 'Aug 16'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Meaning-of-set-Memo-Aug-16/m-p/459031#M116541</link>
      <description>&lt;P&gt;I'm not familiar with that&amp;nbsp;@ symbol in an assignment statement -- but it could be a piece of esoteric legacy that someone else could weigh in on.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The most common use of the&amp;nbsp;@ symbol to control assignments is in the INPUT statement, using it to advance the input pointer to a specific part of the input stream.&amp;nbsp; In this example, the&amp;nbsp;@ operator tells SAS to find the pattern "Memo" and then reads the value just beyond that point.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  length date 8;
  informat date date9.;
  format date date9.;
  infile datalines;
  input @ "Memo" date;
datalines;
Here's the Memo 16Aug2017
Another Memo 16Nov2018
Final Memo 15Oct2014
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="op.png" style="width: 168px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/20291i95B2CFD3E1C7CED1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="op.png" alt="op.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 16:37:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Meaning-of-set-Memo-Aug-16/m-p/459031#M116541</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2018-05-01T16:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Meaning of set @ Memo = 'Aug 16'</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Meaning-of-set-Memo-Aug-16/m-p/459043#M116544</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/122200"&gt;@astha8882000&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;I read this line of code somewhere, I understand that the variable 'Memo' is initialized&amp;nbsp; to the value 'Aug 16', what is the purpose of '@'?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Showing the entire code would be better since the '@' can play a number of different roles in reading data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, the user usually goes in and updates the date everyday. Instead of doing that, isn't turning that into a macro variable a better option?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%let Memo = %sysfunc(today());&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Since on 2 May 2018 the macro variable Memo received the value with that call of 21305, likely not the optimal solution.&lt;/P&gt;
&lt;P&gt;You would have to use sufficient SAS functions to make&amp;nbsp;the macro variable appear&amp;nbsp;exactly as&amp;nbsp;the value&amp;nbsp;appears in your data set.&lt;/P&gt;
&lt;P&gt;This might get you started:&lt;/P&gt;
&lt;PRE&gt;Data _null_;
   str=catx(' ',put(today(),monname3.),day(today()));
   call symputx('memo',str);
run;&lt;/PRE&gt;
&lt;P&gt;but may need tweeking if the day part of your search string should be Aug 01 instead of Aug 1.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Don't forget to use "&amp;amp;memo." for the string to resolve properly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note that I find a data set that has to be read this way if only one variable uses it to be very problematic&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2018 18:06:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Meaning-of-set-Memo-Aug-16/m-p/459043#M116544</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-05-01T18:06:07Z</dc:date>
    </item>
  </channel>
</rss>

