<?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: update a variable will result in an error in macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122046#M25015</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please forgive my ignorance, but what do you mean by resubmit the macro? I clicked on the running figure icon to run my program, and got correct results. Lasted, I changed some numbers in the macro part of my code, and clicked that icon again only to find a wrong result. I saved code revised code, closed the SAS window environment, and reoptied it. Now when I click on the running figure to execute the code, I can get the correct result. Do I have to close the SAS window every time I changed my code? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 29 Jun 2013 08:55:03 GMT</pubDate>
    <dc:creator>SeanZ</dc:creator>
    <dc:date>2013-06-29T08:55:03Z</dc:date>
    <item>
      <title>update a variable will result in an error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122043#M25012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi. Please help me with this question. I am not sure if this is a problem in macro. I coded a macro in my SAS program. It ran without problems. I did a regression with independent variable x1 and it worked well, I changed the independent variable to x2 in the macro part. (I changed x1 to x2). This is just a simple change, but I got unexpected results. It still shows results for x1. I close the SAS program thoroughly and re open the program, then everything works fine. I don't know what is the problem, and hate to close and open the program every time I change something in the macro. How can I do with this issue? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2013 07:37:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122043#M25012</guid>
      <dc:creator>SeanZ</dc:creator>
      <dc:date>2013-06-28T07:37:33Z</dc:date>
    </item>
    <item>
      <title>Re: update a variable will result in an error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122044#M25013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you please post the sample SAS Code to let the other people know about why did you get the unexpected output...???&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I don't think it is BLACK HOLE ERROR in SAS if it is then SAS Stops to respond...It will be better if you post sample code...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Urvish&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2013 10:51:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122044#M25013</guid>
      <dc:creator>UrvishShah</dc:creator>
      <dc:date>2013-06-28T10:51:47Z</dc:date>
    </item>
    <item>
      <title>Re: update a variable will result in an error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122045#M25014</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you resubmit the macro code to update the compiled macro code available to SAS? That is what is sounds like to me. If you change code in the macro you cant just run the macro call again you must submit the macro definition so SAS can update to the changes made.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 28 Jun 2013 13:33:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122045#M25014</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-06-28T13:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: update a variable will result in an error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122046#M25015</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please forgive my ignorance, but what do you mean by resubmit the macro? I clicked on the running figure icon to run my program, and got correct results. Lasted, I changed some numbers in the macro part of my code, and clicked that icon again only to find a wrong result. I saved code revised code, closed the SAS window environment, and reoptied it. Now when I click on the running figure to execute the code, I can get the correct result. Do I have to close the SAS window every time I changed my code? Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Jun 2013 08:55:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122046#M25015</guid>
      <dc:creator>SeanZ</dc:creator>
      <dc:date>2013-06-29T08:55:03Z</dc:date>
    </item>
    <item>
      <title>Re: update a variable will result in an error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122047#M25016</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;THank you for your reply. I don't have access to my code today. I can post tomorrow. But my question was described further in the reply to EJ. From there you may seeh what happened to me.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Jun 2013 08:58:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122047#M25016</guid>
      <dc:creator>SeanZ</dc:creator>
      <dc:date>2013-06-29T08:58:40Z</dc:date>
    </item>
    <item>
      <title>Re: update a variable will result in an error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122048#M25017</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Sean,&lt;/P&gt;&lt;P&gt;No, you do not have to close SAS every time you change your code.&amp;nbsp; But, there are mistakes you could make in the code that could give you that impression.&amp;nbsp; Posting your code will help folks help you.&amp;nbsp; And as with any debugging exercise, try to narrow it down to the simplest example that shows your problem.&amp;nbsp; That will also make it easier for forlks to help you.&amp;nbsp; Often I find that when I go through the exercise of excluding extraneous code to make a nice clear example to post to the group, the solution becomes apparent.&lt;/P&gt;&lt;P&gt;-Q.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Jun 2013 12:07:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122048#M25017</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2013-06-29T12:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: update a variable will result in an error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122049#M25018</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The code between the %MACRO and %MEND statements DEFINE the macro.&amp;nbsp; Then at some other place in your code you execute the macro by calling it with something like: %macroname.&lt;/P&gt;&lt;P&gt;When you run the code that has the %MACRO statement the macro is compiled.&amp;nbsp; Then when you run the code with the %macroname call the macro executes.&amp;nbsp; So if you make changes in the code between the %macro and %mend statements without re-running that part of the program the definition of the macro will not change.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The other thing to check is that you have properly closed all of your comments, quoted string and data steps and procedutes. It is possible that the first few lines of the second attempt to run the program are not being run because of this type of confusion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Jun 2013 12:22:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122049#M25018</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-06-29T12:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: update a variable will result in an error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122050#M25019</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I agree without seeing the code we can only offer general help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Jun 2013 17:49:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122050#M25019</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-06-29T17:49:18Z</dc:date>
    </item>
    <item>
      <title>Re: update a variable will result in an error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122051#M25020</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Great explanation and tips &lt;A __default_attr="2431" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/" modifiedtitle="true" title="Tom"&gt;&lt;/A&gt;!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The evil orphaned quotation mark has drove me to bang my head against the wall with some of my programs!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EJ&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Jun 2013 17:51:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122051#M25020</guid>
      <dc:creator>esjackso</dc:creator>
      <dc:date>2013-06-29T17:51:25Z</dc:date>
    </item>
    <item>
      <title>Re: update a variable will result in an error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122052#M25021</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you all for the helpful comments. I post part of the code I wrote. In the data set imported (temp), there are variables mkt, smb, ret, and others. I use %let x1=mkt for the first run, I got correct results. Later, I change the code to %let x1=smb for a new run. I cannot get&amp;nbsp; the correct result. Error message shows that there is no variable smb found. When I checked the interim step, I found that although I changed the code to "smb", the data still showed old variable "mkt" instead of new one I expected. Please help me check what's wrong with it. Thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-----------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;options nosource nodate nocenter nonumber ps=max;&lt;/P&gt;&lt;P&gt;title 'Fama-MacBeth Rolling Regression Results ';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;ods html close; &lt;/P&gt;&lt;P&gt;ods preferences;&lt;/P&gt;&lt;P&gt;ods html newfile=proc; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc import datafile="D:\work\data.dta" out=temp dbms = dta replace; * out= name of file of output, in work folder;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;*Compute time series regressions each month and save the coefficients;&lt;/P&gt;&lt;P&gt;proc sort data = temp;&lt;/P&gt;&lt;P&gt;by productreference n;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Define independent and dependent variables;&lt;/P&gt;&lt;P&gt;%let x1=mkt;&lt;/P&gt;&lt;P&gt;%let y=ret;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro tsreg; * time series regression;&lt;/P&gt;&lt;P&gt;%do m = 37 %to 216; * from month 37 to 216;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; data roll; set temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if &amp;amp;m - 36 &amp;lt;= n &amp;lt; &amp;amp;m; * Past 36 months data;&lt;/P&gt;&lt;P&gt;&amp;nbsp; mon = &amp;amp;m;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc reg data=roll noprint outest=results EDF;&lt;/P&gt;&lt;P&gt;&amp;nbsp; model &amp;amp;y=&amp;amp;x1;&lt;/P&gt;&lt;P&gt;&amp;nbsp; by productreference mon;&lt;/P&gt;&lt;P&gt;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; proc append base = betas1 data = results force; * append data "results" and save to betas1;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%mend tsreg;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%tsreg&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;* Include only those have 36 observations;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table betas as &lt;/P&gt;&lt;P&gt;&amp;nbsp; select productreference, &amp;amp;x1, mon, (_EDF_ + _P_) as obs&lt;/P&gt;&lt;P&gt;&amp;nbsp; from betas1&lt;/P&gt;&lt;P&gt;&amp;nbsp; having (_EDF_ + _P_) = 36;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Merge betas with next month return*/;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;&amp;nbsp; create table fmb as&lt;/P&gt;&lt;P&gt;&amp;nbsp; select *&lt;/P&gt;&lt;P&gt;&amp;nbsp; from betas(drop=obs) a, temp(keep=productreference &amp;amp;y n) b &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&amp;nbsp; where a.productreference = b.productreference and&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; a.mon = b.n;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* Cross-sectional regression to get monthly premium and intercept*/&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sort data = fmb;&lt;/P&gt;&lt;P&gt;by n;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc reg data = fmb noprint outest = final;&lt;/P&gt;&lt;P&gt;model &amp;amp;y = &amp;amp;x1;&lt;/P&gt;&lt;P&gt;by n;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc means mean n std t prt data = final; * Time series average of intercept and mkt coefficient;&lt;/P&gt;&lt;P&gt;var intercept &amp;amp;x1;&lt;/P&gt;&lt;P&gt;run; &lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 29 Jun 2013 20:17:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122052#M25021</guid>
      <dc:creator>SeanZ</dc:creator>
      <dc:date>2013-06-29T20:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: update a variable will result in an error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122053#M25022</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here are some thoughts/questions, I think the last one may be the issue.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1.&amp;nbsp; If you start a new SAS session and paste in the code you posted, do you replicate the problem? (It works when you run the first time with &amp;amp;x1=mkt but fails when you change it to &amp;amp;x1=smb?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp; Assuming that does replicate the problem, if you start a new session, and paste in the cdoe, and set &amp;amp;x1=smb for the first frun in that session, does it work?&amp;nbsp; What if you use &amp;amp;x1=mkt for the second run?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. When you check the log, are you looking for the FIRST error/warning/ bad note that you see?&amp;nbsp; if SMB does not exist in the source data, then the first regression will fail. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;4&amp;nbsp; Sprikle your code with: %put x1=&amp;gt;&amp;gt;&amp;amp;x1.&amp;lt;&amp;lt;;&amp;nbsp; to see how macro vars resolve at each point (and/or turn on OPTIONS SYMBOLGEN).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5. Remember that if you do your testing in an interactive session, all your work datasets will still be around at the end.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually, just hit me that #5 may be the key, especially because you are using PROC APPEND with FORCE option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first time you run your code with &amp;amp;x1=mkt,&amp;nbsp; the dataset BETAS1 will have the variable MKT in it (and other variables).&amp;nbsp; When you then run it a second time with &amp;amp;x1=smb, BETAS1 will already exist from the earlier run, with MKT in it but not SMB.&amp;nbsp; When you run PROC APPEND with FORCE, I think the records will be appended, but the SMB variable will not be added to the dataaset, because it does not exist in the base dataset.&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you add proc datasets library=work memtype=data; delete betas1; quit;&amp;nbsp; to the bottom of your code, it will delete work.betas1 after you run with &amp;amp;x=mkt, so that when you then run wit with &amp;amp;x1=smb the proc append step will create a new dataset, which has smb in it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;HTH,&lt;/P&gt;&lt;P&gt;--Q.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Jun 2013 12:57:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122053#M25022</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2013-06-30T12:57:17Z</dc:date>
    </item>
    <item>
      <title>Re: update a variable will result in an error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122054#M25023</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you a lot for your time. It's a perfect solution. I verified it by manually remove beta1 data after the first run, change the variables, and retest it with correct answer. It is the beta1 file that caused the problem. Now I have another question. I would like to do a loop to run them together. Specifically, I have about 15 regressors. I want to do univariate regression (ret vs. each of 15 regressors) 15 times. So I set &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%let x1=mkt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%let x2=smb;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%let x3=hml;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;...&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%let y=ret;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;/P&gt;&lt;P style="font-size: 12.800000190734863px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;mkt smb hml and so on are just factors (regressors). Is it easy to write a do loop outside my code to do it? I can write it easily in Matlab or STATA, but for SAS I am just a newbie. I appreciate a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 30 Jun 2013 20:37:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122054#M25023</guid>
      <dc:creator>SeanZ</dc:creator>
      <dc:date>2013-06-30T20:37:51Z</dc:date>
    </item>
    <item>
      <title>Re: update a variable will result in an error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122055#M25024</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could keep your program the same and change the PROC APPEND &lt;SPAN style="background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt; line-height: 1.5em;"&gt;to :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data betas1 ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp; set betas1 results;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;To make sure there is a BETAS1 file before your macro call run you could use this simple data step: &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;data betas1; stop; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;to create an empty dataset (no variables and no observations).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 01 Jul 2013 01:53:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122055#M25024</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2013-07-01T01:53:47Z</dc:date>
    </item>
    <item>
      <title>Re: update a variable will result in an error in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122056#M25025</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;thanks a lot! That works great!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 05 Jul 2013 20:03:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/update-a-variable-will-result-in-an-error-in-macro/m-p/122056#M25025</guid>
      <dc:creator>SeanZ</dc:creator>
      <dc:date>2013-07-05T20:03:00Z</dc:date>
    </item>
  </channel>
</rss>

