<?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: Error: Variable not Found in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942797#M42327</link>
    <description>&lt;P&gt;The PROC CONTENTS report contains at the bottom a table titled Alphabetical List of Variables and Attributes. From the screenshot, it doesn't look like waterfall_frb_ny is a variable in the PledgeDataLoanLevel5 dataset hence the error.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 05 Sep 2024 18:42:36 GMT</pubDate>
    <dc:creator>antonbcristina</dc:creator>
    <dc:date>2024-09-05T18:42:36Z</dc:date>
    <item>
      <title>Error: Variable not Found</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942753#M42323</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Restarting my topic here.&amp;nbsp; I have an issue where I have encountered an error. I'm not familiar with SAS but I would like to have it fix.&lt;/P&gt;&lt;P&gt;Below is the error's snapshot&amp;nbsp;and code.&lt;/P&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="sas errir.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100014i0165E8513B216A66/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sas errir.PNG" alt="sas errir.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;PRE&gt;PROC IMPORT OUT= PledgeDataLoanLevel8
              DATAFILE= "&amp;amp;importfolder./CTL_2_CD 300 - &amp;amp;hereportdate. FRBNY Waterfall.xlsx"
            DBMS=XLSX 
                                                REPLACE;
     GETNAMES=YES;   SHEET = 'Breakout'; 
RUN;

data  PledgeDataLoanLevel8;
set  PledgeDataLoanLevel8;
if src_sys_tx in ('') then delete;
if src_sys_tx in ('Total', 'Prior Month') then delete;
if loan_nb = . then delete; 
run;

proc freq data = PledgeDataLoanLevel4 ; tables final_waterfall   ;run;
proc freq data = PledgeDataLoanLevel5 ; tables waterfall_frb_ny   ;run;
proc freq data = PledgeDataLoanLevel6 ; tables final_waterfall   ;run;
proc freq data = PledgeDataLoanLevel7 ; tables waterfall   ;run;
proc freq data = PledgeDataLoanLevel8 ; tables waterfall_frb_ny   ;run;

proc sql;
select
final_waterfall ,
sum  (upb) as upb format = comma20.2       /**  FHLB SF WAMU HE ***/  
from PledgeDataLoanLevel4
group by   final_waterfall 
order by   final_waterfall 
;quit; &lt;/PRE&gt;&lt;P&gt;Hope to hear from experts of the possible solutions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cykelops&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 16:14:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942753#M42323</guid>
      <dc:creator>Cykelops</dc:creator>
      <dc:date>2024-09-05T16:14:48Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Variable not Found</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942761#M42325</link>
      <description>&lt;P&gt;If the variable isn't there what do you expect us to do???&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Show us the results of Proc Contents for that data set. Maybe the name is misspelled.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note: Proc IMPORT is a guessing procedure. The results for things like variables names can be problematic. If the previous data set you read with Proc Import had one spelling for the column that created the variable that may not be the case for the latest. Or someone may have changed the contents a LOT and you won't know it until you examine the actual data set generated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 16:59:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942761#M42325</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-09-05T16:59:33Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Variable not Found</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942779#M42326</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;see proc contents below. Not sure how to look at it and how we can determine the correct spelling.&lt;/P&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="proc contents.PNG" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/100024i023044368F25BDE3/image-size/medium?v=v2&amp;amp;px=400" role="button" title="proc contents.PNG" alt="proc contents.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;Please advise. Hope this helps.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 18:06:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942779#M42326</guid>
      <dc:creator>Cykelops</dc:creator>
      <dc:date>2024-09-05T18:06:25Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Variable not Found</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942797#M42327</link>
      <description>&lt;P&gt;The PROC CONTENTS report contains at the bottom a table titled Alphabetical List of Variables and Attributes. From the screenshot, it doesn't look like waterfall_frb_ny is a variable in the PledgeDataLoanLevel5 dataset hence the error.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 18:42:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942797#M42327</guid>
      <dc:creator>antonbcristina</dc:creator>
      <dc:date>2024-09-05T18:42:36Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Variable not Found</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942800#M42328</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/84234"&gt;@antonbcristina&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Since this "&lt;SPAN&gt;waterfall_frb_ny" does not really exist. I would like to know if this is something that is being created or do I need to look for an excel or database (.dat) to verify other tables like Final Waterfall. I like to know why it is not existing. I run this report last month and I don't have any issue. While I really don't know how to read SAS code, maybe you could guide me in investigating it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Hoping for your reply..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Cykelops&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 19:09:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942800#M42328</guid>
      <dc:creator>Cykelops</dc:creator>
      <dc:date>2024-09-05T19:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Variable not Found</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942801#M42329</link>
      <description>&lt;P&gt;If you ran the same code then the inputs have changed.&lt;/P&gt;
&lt;P&gt;Your code seems to be reading in data from EXCEL files.&amp;nbsp; So the EXCEL files are different.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 19:14:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942801#M42329</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-09-05T19:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Variable not Found</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942804#M42330</link>
      <description>&lt;P&gt;In the first screenshot you provided, it seems like each PledgeDataLoanLevelx dataset is being created from a PROC IMPORT step above. Look for the PROC IMPORT step that created PledgeDataLoadLevel5 and locate the source file being imported (they seem to be Excel spreadsheets). You'll want to open this source file and look for the variable names. Chances are this source file has been updated and the variable names no longer match.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;From the PROC FREQ steps you shared, it seems that some of these source files have a final_waterfall or waterfall_frb_ny variable. Change the PROC FREQ step to use the appropriate variable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 19:27:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942804#M42330</guid>
      <dc:creator>antonbcristina</dc:creator>
      <dc:date>2024-09-05T19:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Variable not Found</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942811#M42331</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/467272"&gt;@Cykelops&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/84234"&gt;@antonbcristina&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Since this "&lt;SPAN&gt;waterfall_frb_ny" does not really exist. I would like to know if this is something that is being created or do I need to look for an excel or database (.dat) to verify other tables like Final Waterfall. I like to know why it is not existing. I run this report last month and I don't have any issue. While I really don't know how to read SAS code, maybe you could guide me in investigating it.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hoping for your reply..&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Cykelops&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Perhaps the real question here is why do you think there should be a variable "waterfall_frb_ny" at all.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am going to &lt;STRONG&gt;guess&lt;/STRONG&gt; that you were given this code by someone else. Which means that you have very likely fallen to one of the issues with spreadsheets: people change them. It might be related to a similar project and may even have the same file names but what is in the file has changed. If it isn't there you can't use it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the only place that this variable is mentioned is in that one piece of code then just don't run it. If it is used anywhere else need to go to whoever assigned this activity and tell them pieces are missing. Take the Proc Contents results when you do. You may need to run Proc Contents on all of those data sets to make sure they contain the variables expected of them.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want us to create a waterfall_frb_ny you would have to provide the rules and the base data, or at least examples there of, on how it is to be created.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have one project I have been working with for going on 12 years. On average one or more of the spreadsheets the data source extracts data to changes every three months. And these are generated by someone's programs. If people are manually entering data the problems with things like changed column headers (i.e. variable names), missing data, improperly entered data get much worse.&lt;/P&gt;
&lt;P&gt;Even when the variable contents don't change they have changed the order of columns in the data, which is a headache as I use data steps to read them because it is the only way to make sure things like variable types and lengths don't change from file to file.&lt;/P&gt;
&lt;P&gt;They also change the number of header rows periodically.&lt;/P&gt;
&lt;P&gt;I have even received files that part&amp;nbsp; way through the file a column that is supposed to be a date of enrollment field starts appearing as currency, or currency that becomes dates. Consider, what is 2023-03-15 supposed to mean in terms of $? ($45,000 actually)&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 20:05:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942811#M42331</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-09-05T20:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Error: Variable not Found</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942814#M42332</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/84234"&gt;@antonbcristina&lt;/a&gt;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you both of your explanation. I was able to check the excel file uploaded in SAS Viya and there is a difference compared to last month. Under the tab FRBNY HE at column D, there is a header name "Final_Waterfall" while last month the header name is "WATERFALL_FRB_NY". I think this the reason why "Waterfall_FRB_NY" variable is missing.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have learned a lot today especially the use of PROC Contents. Thanks to both of you.&lt;/P&gt;
&lt;P&gt;Cykelops&lt;/P&gt;</description>
      <pubDate>Thu, 05 Sep 2024 20:17:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Error-Variable-not-Found/m-p/942814#M42332</guid>
      <dc:creator>Cykelops</dc:creator>
      <dc:date>2024-09-05T20:17:59Z</dc:date>
    </item>
  </channel>
</rss>

