<?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: Calling SAS files from &amp;quot;physical&amp;quot;  location in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Calling-SAS-files-from-quot-physical-quot-location/m-p/965890#M375992</link>
    <description>&lt;P&gt;If you reference a dataset using a single name like A1 or A2 then it will look for WORK.A1 or WORK.A2.&amp;nbsp; WORK datasets are removed when your SAS session ends.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to instead find CHECK.A1 then say so in the SAS code you ask the macro processor to generate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note if you just want to check a set of datasets that end with a sequence of integers then there is no need for macro code.&amp;nbsp; You can use a list of dataset names instead like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set check.a1 - check.a2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 06 May 2025 17:40:11 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2025-05-06T17:40:11Z</dc:date>
    <item>
      <title>Calling SAS files from "physical"  location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-SAS-files-from-quot-physical-quot-location/m-p/965888#M375990</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;DIV&gt;I need to save SAS files locally so others can access them (it cannot be saved in my SAS library). This is data being extracted from REDCap.&amp;nbsp;With each one of my weekly data extractions I create multiple SAS files (A1 A2 A3 etc) that must be merged weekly, to create a database to be used in a code that compares new records with old ones for issues.&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;My code to call and merge these files only works for the latest created file, in this case A5, it tells me files 1 to 4 do not exist. Files I have saved in my computer in previous weeks.&lt;/DIV&gt;&lt;DIV&gt;What am I missing?&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Libname CHECK 'C:my desktop folder where the SAS files (A1 to A5) are';&lt;/SPAN&gt;&lt;DIV&gt;%macro combine;&lt;/DIV&gt;&lt;DIV&gt;data want;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; set&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; %do i = 1 %to 5; &amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; &amp;nbsp; A&amp;amp;i&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; %end;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp; ;&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;%combine;&lt;/DIV&gt;&lt;DIV&gt;**********************************&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I appreciate your help.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 May 2025 16:59:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-SAS-files-from-quot-physical-quot-location/m-p/965888#M375990</guid>
      <dc:creator>Mscarboncopy</dc:creator>
      <dc:date>2025-05-06T16:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Calling SAS files from "physical"  location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-SAS-files-from-quot-physical-quot-location/m-p/965889#M375991</link>
      <description>&lt;BLOCKQUOTE&gt;
&lt;P&gt;..&lt;SPAN&gt;in this case A5, it tells me files 1 to 4 do not exist&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do not paraphrase the messages. We need the exact word-for-word message. The best way is to show us the ENTIRE log from running this macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please run this command first, to turn on macro debugging.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options mprint;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then run your macro, and paste the log into the window that appears when you click on the &amp;lt;/&amp;gt; icon. Do not skip this step.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PaigeMiller_0-1699900743276.png" style="width: 859px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/89703i797B759183DE7484/image-size/large?v=v2&amp;amp;px=999" role="button" title="PaigeMiller_0-1699900743276.png" alt="PaigeMiller_0-1699900743276.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And from now on, if you get errors, please do show us the log. Don't wait until we ask.&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 17:06:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-SAS-files-from-quot-physical-quot-location/m-p/965889#M375991</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2025-05-06T17:06:23Z</dc:date>
    </item>
    <item>
      <title>Re: Calling SAS files from "physical"  location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-SAS-files-from-quot-physical-quot-location/m-p/965890#M375992</link>
      <description>&lt;P&gt;If you reference a dataset using a single name like A1 or A2 then it will look for WORK.A1 or WORK.A2.&amp;nbsp; WORK datasets are removed when your SAS session ends.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to instead find CHECK.A1 then say so in the SAS code you ask the macro processor to generate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Note if you just want to check a set of datasets that end with a sequence of integers then there is no need for macro code.&amp;nbsp; You can use a list of dataset names instead like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set check.a1 - check.a2;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 17:40:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-SAS-files-from-quot-physical-quot-location/m-p/965890#M375992</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-05-06T17:40:11Z</dc:date>
    </item>
    <item>
      <title>Re: Calling SAS files from "physical"  location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-SAS-files-from-quot-physical-quot-location/m-p/965899#M375993</link>
      <description>&lt;P&gt;This is what my log shows. The issue seems to be that the macro code is searching for the files in my SAS library but they are not there. How do I change this code to look for these files A1 A2 A3 A4 A5 in my desktop? Maybe there isn't a way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class=""&gt;&amp;nbsp;options mprint;&lt;/DIV&gt;&lt;DIV class=""&gt;15198 &amp;nbsp;%macro combine;&lt;/DIV&gt;&lt;DIV class=""&gt;15199&lt;/DIV&gt;&lt;DIV class=""&gt;15200&lt;/DIV&gt;&lt;DIV class=""&gt;15201 &amp;nbsp;data ALL;&lt;/DIV&gt;&lt;DIV class=""&gt;15202 &amp;nbsp; &amp;nbsp;set&lt;/DIV&gt;&lt;DIV class=""&gt;15203 &amp;nbsp; &amp;nbsp;%do i = 1 %to 5;&lt;/DIV&gt;&lt;DIV class=""&gt;15204&amp;nbsp; &amp;nbsp; &amp;nbsp; A&amp;amp;i&lt;/DIV&gt;&lt;DIV class=""&gt;15205 &amp;nbsp; &amp;nbsp;%end;&lt;/DIV&gt;&lt;DIV class=""&gt;15206 &amp;nbsp; &amp;nbsp;;&lt;/DIV&gt;&lt;DIV class=""&gt;15207 &amp;nbsp;run;&lt;/DIV&gt;&lt;DIV class=""&gt;15208&lt;/DIV&gt;&lt;DIV class=""&gt;15209 &amp;nbsp;%mend;&lt;/DIV&gt;&lt;DIV class=""&gt;15210&lt;/DIV&gt;&lt;DIV class=""&gt;15211 &amp;nbsp;%combine;&lt;/DIV&gt;&lt;DIV class=""&gt;MPRINT(COMBINE): &amp;nbsp; data ALL;&lt;/DIV&gt;&lt;DIV class=""&gt;MPRINT(COMBINE): &amp;nbsp; set A1 A2 A3 A4 A5 ;&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: File MYSAS.A1.DATA does not exist.&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: File MYSAS.A2.DATA does not exist.&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: File MYSAS.A3.DATA does not exist.&lt;/DIV&gt;&lt;DIV class=""&gt;ERROR: File MYSAS.A4.DATA does not exist.&lt;/DIV&gt;&lt;DIV class=""&gt;MPRINT(COMBINE): &amp;nbsp; run;&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/DIV&gt;&lt;DIV class=""&gt;WARNING: The data set MYSAS.ALL&amp;nbsp;may be incomplete. &amp;nbsp;When this step was stopped there were 0&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;observations and 16 variables.&lt;/DIV&gt;&lt;DIV class=""&gt;NOTE: DATA statement used (Total process time):&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; real time &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0.00 seconds&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; cpu time &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;0.00 seconds&lt;/DIV&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 May 2025 20:54:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-SAS-files-from-quot-physical-quot-location/m-p/965899#M375993</guid>
      <dc:creator>Mscarboncopy</dc:creator>
      <dc:date>2025-05-06T20:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Calling SAS files from "physical"  location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-SAS-files-from-quot-physical-quot-location/m-p/965900#M375994</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&lt;/P&gt;&lt;P&gt;Thank you!! That works.&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 21:03:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-SAS-files-from-quot-physical-quot-location/m-p/965900#M375994</guid>
      <dc:creator>Mscarboncopy</dc:creator>
      <dc:date>2025-05-06T21:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Calling SAS files from "physical"  location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-SAS-files-from-quot-physical-quot-location/m-p/965908#M375996</link>
      <description>&lt;P&gt;For that code to generate those messages you must have set the system option USER to the value MYSAS.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It used to be if you defined a libref named USER then single names dataset references, like the A1 and A2 in your code, would reference USER.A1 and USER.A2 instead of the normal WORK.A1 and WORK.A2.&amp;nbsp; At some point in the last 20 years or so SAS added the USER system option where you could name a different libref instead.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You original code was making a libref named CHECK.&amp;nbsp; But I did not see any code to make a libref named MYSAS.&lt;/P&gt;</description>
      <pubDate>Tue, 06 May 2025 23:00:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-SAS-files-from-quot-physical-quot-location/m-p/965908#M375996</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2025-05-06T23:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Calling SAS files from "physical"  location</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Calling-SAS-files-from-quot-physical-quot-location/m-p/966023#M376010</link>
      <description>&lt;P&gt;The code for mysas was not shared. Between the first question in the thread from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/374215"&gt;@paige2&lt;/a&gt; thank you!&amp;nbsp; and your answer, I figured out the issue was exactly what you mentioned. I was not aware I could call files the way you showed me. Thank you so much &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 May 2025 21:13:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Calling-SAS-files-from-quot-physical-quot-location/m-p/966023#M376010</guid>
      <dc:creator>Mscarboncopy</dc:creator>
      <dc:date>2025-05-07T21:13:20Z</dc:date>
    </item>
  </channel>
</rss>

