<?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: Remove &amp;quot;.DATA&amp;quot; from a macro variable used in a set statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455589#M115270</link>
    <description>&lt;P&gt;I must say, you're comment here struck a nerve with me.&amp;nbsp; At first, i was kind of upset - how could they?&amp;nbsp; But then I realized, maybe what this person is really trying to do is motivate me.&amp;nbsp; So, I took to proving you wrong so that I could get to where I need to be.&amp;nbsp; In that, I was proving that the var generated for the set statement was as it should be....and it is.&amp;nbsp; I checked with a&amp;nbsp;prog that already has it, and the file location itself.&amp;nbsp; it all matched.&amp;nbsp; but i was sitll getting the error...then it donned on me to check the libname statement.&amp;nbsp; i did and discovered i left out the leading forward slash.&amp;nbsp; i put that in and everything is icecream.&amp;nbsp; you're right though, i should have known that the .DATA is a feature of the message, not what was actually being executed.&amp;nbsp; I won't forget that the next time around.&amp;nbsp; before i hang my head in shame, i just want to thank you, and anyone else who's attempted to help my mistake here.&amp;nbsp; i shall not forget this episode.&amp;nbsp; ok, now im hanging my head...................................and I'm done. moving on.&amp;nbsp; &amp;nbsp;thanks again.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Apr 2018 13:03:09 GMT</pubDate>
    <dc:creator>prolifious</dc:creator>
    <dc:date>2018-04-19T13:03:09Z</dc:date>
    <item>
      <title>Remove ".DATA" from a macro variable used in a set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455363#M115170</link>
      <description>&lt;P&gt;Here is my code:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;libname file0 'x/y/z';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;yest = today() -1;&lt;/P&gt;&lt;P&gt;a = 'hamming_';&lt;/P&gt;&lt;P&gt;call symput('inventions',put("file0.",$6.)||put(a,$8.)||put(yest,yymmddn8.));&lt;/P&gt;&lt;P&gt;options symbolgen;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data temp0;&lt;/P&gt;&lt;P&gt;set &amp;amp;inventions (obs=1);&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc print data=temp0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;symbolgen returns 'file0.hamming_20180417'&lt;/P&gt;&lt;P&gt;and i get an error in the set statement saying&amp;nbsp;&lt;SPAN&gt;FILE 'file0.hamming_20180417.DATA' does not exist.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;How can I remove this '.DATA'?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Jon&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 19:25:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455363#M115170</guid>
      <dc:creator>prolifious</dc:creator>
      <dc:date>2018-04-18T19:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ".DATA" from a macro variable used in a set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455368#M115171</link>
      <description>&lt;P&gt;You should get more errors than the one you showed as there were other errors in your code. And I think an extra space was imbedded in the file name. The following worked for me:&lt;/P&gt;
&lt;PRE&gt;libname file0 '/folders/myfolders';

data _null_;
  yest = today() -1;
  a = 'hamming_';
  call symput('inventions',put("file0.",$6.)||put(a,$8.)||put(yest,yymmddn8.));
  options symbolgen;
run;

data &amp;amp;inventions.;
  set sashelp.class;
run;

data temp0;
  set &amp;amp;inventions (obs=1);
run;

proc print data=temp0;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 19:29:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455368#M115171</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-04-18T19:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ".DATA" from a macro variable used in a set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455372#M115173</link>
      <description>&lt;P&gt;thank you, yes in masking my actual program i made a couple errors, but i think i corrected them as you were responding...thank you!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, can you please explain the structure:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data &amp;amp;inventions. ;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; set sashelp.class;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;whats going on there?&amp;nbsp; why do i need it?&amp;nbsp; I'm not questing if it should be there, i would just like to understand a bit on it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Jon&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 19:34:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455372#M115173</guid>
      <dc:creator>prolifious</dc:creator>
      <dc:date>2018-04-18T19:34:49Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ".DATA" from a macro variable used in a set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455380#M115176</link>
      <description>&lt;P&gt;this is not working for me.&amp;nbsp; I still get the message from the set statement noting "xyz.DATA" does not exist, but the symbolgen produces the precise var that i want.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 19:48:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455380#M115176</guid>
      <dc:creator>prolifious</dc:creator>
      <dc:date>2018-04-18T19:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ".DATA" from a macro variable used in a set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455385#M115180</link>
      <description>&lt;P&gt;Since your code was trying to open an existing file, I simply created that file using the datastep to create it with a copy of sashelp.class.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Unless you changed your symbolgen to match the one in my code, it was actually creating a macro variable that contained:&lt;/P&gt;
&lt;PRE&gt;file0.hamming_ 20180417&lt;/PRE&gt;
&lt;P&gt;A dataset name cannot include an imbedded blank.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My code, on the other hand, produced:&lt;/P&gt;
&lt;PRE&gt;file0.hamming_20180417&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 20:02:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455385#M115180</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-04-18T20:02:21Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ".DATA" from a macro variable used in a set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455386#M115181</link>
      <description>&lt;P&gt;i notice in the log that everything is capitalized in the FILE 'FILE0....DATA' does not exist statement, but my actual file is all lower-case.&amp;nbsp; do i need to constrict it to lower-case?&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 20:03:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455386#M115181</guid>
      <dc:creator>prolifious</dc:creator>
      <dc:date>2018-04-18T20:03:23Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ".DATA" from a macro variable used in a set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455387#M115182</link>
      <description>&lt;P&gt;yes, i corrected that error.&amp;nbsp; the code listed in my initial comment is fixed, and reflects my actual program.&amp;nbsp; thank you.&amp;nbsp; It still does not work.&amp;nbsp; is the variable being capitalized when referencing my file?&amp;nbsp; my file name is all lower case.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 20:05:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455387#M115182</guid>
      <dc:creator>prolifious</dc:creator>
      <dc:date>2018-04-18T20:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ".DATA" from a macro variable used in a set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455388#M115183</link>
      <description>&lt;P&gt;No. The log is simply showing it as uppercase, but it is actually lowercase.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 20:07:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455388#M115183</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-04-18T20:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ".DATA" from a macro variable used in a set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455391#M115184</link>
      <description>&lt;P&gt;Is &lt;SPAN&gt;file0.hamming_20180417 a SAS dataset? If it isn't, you can't access it with a set statement.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Art, CEO, AnalystFinder.com&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 20:12:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455391#M115184</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2018-04-18T20:12:08Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ".DATA" from a macro variable used in a set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455392#M115185</link>
      <description>&lt;P&gt;Based on the questions you are asking, you have been seriously misled.&amp;nbsp; This is not a good project for you.&amp;nbsp; It is unreasonable, dangerous, and should be postponed for 6 months until you have more experience using SAS language.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Macro language generates SAS programs.&amp;nbsp; You need more experience with SAS, to be able to visualize what a working SAS program looks like.&amp;nbsp; Even if your macro code runs without error, you won't know whether the program it generates is good or bad.&amp;nbsp; It is just too early in the game to be worrying about macro language.&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 20:12:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455392#M115185</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-04-18T20:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ".DATA" from a macro variable used in a set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455491#M115217</link>
      <description>&lt;P&gt;The extension .DATA is always appended when a dataset name is included in the log. This can't be removed, as it is a given property of the SAS logger.&lt;/P&gt;
&lt;P&gt;(if you were reading a view, the extension would be .VIEW, for example)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your data _null_ code can be greatly simplified:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
yest = today() -1;
call symput('inventions',"file0.hamming_"||put(yest,yymmddn8.));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that no put() is needed for character variables, if you use them. But consider the use of strip() to remove leading and trailing blanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the error, look if a file&lt;/P&gt;
&lt;PRE&gt;hamming_20180418.sas7bdat&lt;/PRE&gt;
&lt;P&gt;exists in directory&lt;/P&gt;
&lt;PRE&gt;x/y/z&lt;/PRE&gt;
&lt;P&gt;(or whatever is your real location).&lt;/P&gt;
&lt;P&gt;SAS dataset filenames must be lowercase(!) in the file system, although SAS always spells them out in uppercase in the logs or in resources like dictionary.tables. That is a remnant of SAS's mainframe roots (where everything is uppercase), and the migration to UNIX (where filenames are &lt;EM&gt;mostly&lt;/EM&gt; lowercase, and case-sensitive).&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 07:54:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455491#M115217</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-19T07:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ".DATA" from a macro variable used in a set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455589#M115270</link>
      <description>&lt;P&gt;I must say, you're comment here struck a nerve with me.&amp;nbsp; At first, i was kind of upset - how could they?&amp;nbsp; But then I realized, maybe what this person is really trying to do is motivate me.&amp;nbsp; So, I took to proving you wrong so that I could get to where I need to be.&amp;nbsp; In that, I was proving that the var generated for the set statement was as it should be....and it is.&amp;nbsp; I checked with a&amp;nbsp;prog that already has it, and the file location itself.&amp;nbsp; it all matched.&amp;nbsp; but i was sitll getting the error...then it donned on me to check the libname statement.&amp;nbsp; i did and discovered i left out the leading forward slash.&amp;nbsp; i put that in and everything is icecream.&amp;nbsp; you're right though, i should have known that the .DATA is a feature of the message, not what was actually being executed.&amp;nbsp; I won't forget that the next time around.&amp;nbsp; before i hang my head in shame, i just want to thank you, and anyone else who's attempted to help my mistake here.&amp;nbsp; i shall not forget this episode.&amp;nbsp; ok, now im hanging my head...................................and I'm done. moving on.&amp;nbsp; &amp;nbsp;thanks again.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 13:03:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455589#M115270</guid>
      <dc:creator>prolifious</dc:creator>
      <dc:date>2018-04-19T13:03:09Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ".DATA" from a macro variable used in a set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455591#M115272</link>
      <description>&lt;P&gt;Put your mind at rest, it's happened to all of us ...&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 13:06:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455591#M115272</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-04-19T13:06:28Z</dc:date>
    </item>
    <item>
      <title>Re: Remove ".DATA" from a macro variable used in a set statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455599#M115277</link>
      <description>&lt;P&gt;You did well on all counts.&amp;nbsp; No head-hanging needed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your next step on the road (if you haven't done this already) is to omit a semicolon, then try to figure out why the statement that follows is invalid.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best of luck.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Apr 2018 13:18:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-quot-DATA-quot-from-a-macro-variable-used-in-a-set/m-p/455599#M115277</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-04-19T13:18:11Z</dc:date>
    </item>
  </channel>
</rss>

