<?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: %Looping; warning SAS Grid 8.3 WARNING: THE VARIABLE INFO IN THE DROP, KEEP, OR RENAME LIST in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Looping-warning-SAS-Grid-8-3-WARNING-THE-VARIABLE-INFO-IN-THE/m-p/897516#M43788</link>
    <description>Thanks very much, that worked by removing INFO.&lt;BR /&gt;</description>
    <pubDate>Fri, 06 Oct 2023 03:01:12 GMT</pubDate>
    <dc:creator>Biffothebear</dc:creator>
    <dc:date>2023-10-06T03:01:12Z</dc:date>
    <item>
      <title>%Looping; warning SAS Grid 8.3 WARNING: THE VARIABLE INFO IN THE DROP, KEEP, OR RENAME LIST</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Looping-warning-SAS-Grid-8-3-WARNING-THE-VARIABLE-INFO-IN-THE/m-p/897508#M43786</link>
      <description>&lt;P&gt;Hi there,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm a novice sas user. A past colleague wrote some sas code for me to format some data. The code works but gives a warning, does the code need changing to remove the error?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;WARNING: THE VARIABLE INFO IN THE DROP, KEEP, OR RENAME LIST HAS NEVER BEEN REFERENCED&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The warning related to this line of code&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%looping;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;which is at the end of the whole code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the whole code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;%macro weeklyrecon(filename,weeknumber);&lt;/DIV&gt;&lt;DIV&gt;data &amp;amp;filename._FINAL;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;set &amp;amp;filename.;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Start_Date= input(put(&amp;amp;starting_date.,8.),yymmdd8.);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;file_date=Start_date+(&amp;amp;weeknumber.-1)*7;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;format file_date ddmmyy10.;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;File_Document_Number=&amp;amp;weeknumber;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;abc_cost_ID=substr(F1,95,18);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;abc=substr(f1,95,10);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;cost_ID=substr(f1,105,8);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;analysis_1=substr(f1,113,3);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;analysis_2='';&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;analysis_3='';&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Amount=substr(f1,116,15)*1;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Sign=substr(f1,131,1);&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;if sign="+" then DSValue=Amount/100;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;else if sign="-" then DSValue=-Amount/100;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;format DSValue 15.2;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Analysis5='Weekly';&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Analysis6Date='';&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Analysis4=compress(substr(f1,134,3),'!@#',' ');&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;drop f1 info sign amount start_date;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;proc sort data=&amp;amp;filename._FINAL;&lt;/DIV&gt;&lt;DIV&gt;by descending Analysis4;&lt;/DIV&gt;&lt;DIV&gt;run;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;%mend;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;%macro looping;&lt;/DIV&gt;&lt;DIV&gt;%do i=1 %to &amp;amp;filenum.;&lt;/DIV&gt;&lt;DIV&gt;%let prefix=weekly_;&lt;/DIV&gt;&lt;DIV&gt;%let weekly_n=&amp;amp;prefix.&amp;amp;i.;&lt;/DIV&gt;&lt;DIV&gt;%put &amp;amp;&amp;amp;weekly_n.;&lt;/DIV&gt;&lt;DIV&gt;%weeklyrecon(&amp;amp;weekly_n.,&amp;amp;i.);&lt;/DIV&gt;&lt;DIV&gt;%end;&lt;/DIV&gt;&lt;DIV&gt;%mend looping;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;%looping;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 00:32:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Looping-warning-SAS-Grid-8-3-WARNING-THE-VARIABLE-INFO-IN-THE/m-p/897508#M43786</guid>
      <dc:creator>Biffothebear</dc:creator>
      <dc:date>2023-10-06T00:32:57Z</dc:date>
    </item>
    <item>
      <title>Re: %Looping; warning SAS Grid 8.3 WARNING: THE VARIABLE INFO IN THE DROP, KEEP, OR RENAME LIST</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Looping-warning-SAS-Grid-8-3-WARNING-THE-VARIABLE-INFO-IN-THE/m-p/897512#M43787</link>
      <description>&lt;P&gt;It's a WARNING not an ERROR which means it's "ugly" but your code will still fully execute.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You get this warning because in your code you attempt to DROP a variable that doesn't exist.&amp;nbsp; Variable INFO doesn't get created in your data step and it obviously also doesn't pre-exist in your input table &amp;amp;filename.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1696555521162.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/88679iCD372BE32F22B787/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1696555521162.png" alt="Patrick_0-1696555521162.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;You could just remove INFO from your drop statement.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 03:03:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Looping-warning-SAS-Grid-8-3-WARNING-THE-VARIABLE-INFO-IN-THE/m-p/897512#M43787</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-10-06T03:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: %Looping; warning SAS Grid 8.3 WARNING: THE VARIABLE INFO IN THE DROP, KEEP, OR RENAME LIST</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Looping-warning-SAS-Grid-8-3-WARNING-THE-VARIABLE-INFO-IN-THE/m-p/897516#M43788</link>
      <description>Thanks very much, that worked by removing INFO.&lt;BR /&gt;</description>
      <pubDate>Fri, 06 Oct 2023 03:01:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Looping-warning-SAS-Grid-8-3-WARNING-THE-VARIABLE-INFO-IN-THE/m-p/897516#M43788</guid>
      <dc:creator>Biffothebear</dc:creator>
      <dc:date>2023-10-06T03:01:12Z</dc:date>
    </item>
    <item>
      <title>Re: %Looping; warning SAS Grid 8.3 WARNING: THE VARIABLE INFO IN THE DROP, KEEP, OR RENAME LIST</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Looping-warning-SAS-Grid-8-3-WARNING-THE-VARIABLE-INFO-IN-THE/m-p/897517#M43789</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/456395"&gt;@Biffothebear&lt;/a&gt;&amp;nbsp;Just fyi: SAS system option&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lesysoptsref/p0rvc5jmhoebkun1tj10qv4gd2jx.htm" target="_self"&gt;DKROCOND&lt;/A&gt; allows you to change how SAS behaves if dropping a non existent variable.&lt;/P&gt;
&lt;P&gt;I'm of the opinion that one should write code that doesn't get into such a situation but just in case below a code sample how you could suppress the warning.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* store current setting for option dkrocond in macro variable &amp;amp;sv_dkrocond */
%let sv_dkrocond=%sysfunc(getoption(dkrocond,keyword));
/* set option to nowarning */
options dkrocond=nowarning;

data have;
  set sashelp.class;
  drop VarDoesNotExist;
run;

/* restore dkrocond to previous value */
options &amp;amp;sv_dkrocond;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Oct 2023 03:14:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Looping-warning-SAS-Grid-8-3-WARNING-THE-VARIABLE-INFO-IN-THE/m-p/897517#M43789</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-10-06T03:14:49Z</dc:date>
    </item>
  </channel>
</rss>

