<?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: Macro variable not being read... in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408111#M19699</link>
    <description>&lt;P&gt;&lt;SPAN&gt;I didn't look closely, but it might be the single ampersand here.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;amp;XDataset&amp;amp;index&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 27 Oct 2017 17:12:43 GMT</pubDate>
    <dc:creator>WarrenKuhfeld</dc:creator>
    <dc:date>2017-10-27T17:12:43Z</dc:date>
    <item>
      <title>Macro variable not being read...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408109#M19698</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am running into a problem where the macro variable XDataset is not being acknowledged.&lt;BR /&gt;I've tried a few ways to work it, but at its very basis, here is where it goes wrong&lt;BR /&gt;&lt;BR /&gt;Data&lt;BR /&gt;BOTH is a dataset of names of SAS Datasets in a particular library (in2002 which is defined and ok)&lt;BR /&gt;I.e.&amp;nbsp;&amp;nbsp; (There are 24 of them which are being picked up ok)&lt;/P&gt;&lt;P&gt;Name&lt;/P&gt;&lt;TABLE cellspacing="0" cellpadding="5"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ADVERSE_SACQ&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CNTD_P_SACQ&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CONDRUG_SACQ&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CONTRT_SACQ&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;DEMOG_SACQ&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;FINAL_SACQ&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Why can't I access my in2002 file in my macro?&amp;nbsp;&amp;nbsp; Its absolutely there... I've seen that I should&amp;nbsp;add it as a Global variable to my autoexec.sas but I don't have edit access to that file based on admin rights...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The program is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ChkCombine(ImportLibrary2=,ImportLibrary3=);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;LIBNAME in1002 &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"C:\Users\&amp;lt;hidden&amp;gt;\SAS Files\B5201002_201709081643"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;LIBNAME in1003 &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"C:\Users\&amp;lt;hidden&amp;gt;\SAS Files\B5201003_201710101208"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select count(Name) into :NumOfDatasets from Both;&lt;/P&gt;&lt;P&gt;select Name into :XDataset1-:XDataset%&lt;STRONG&gt;&lt;I&gt;trim&lt;/I&gt;&lt;/STRONG&gt;(%&lt;STRONG&gt;&lt;I&gt;left&lt;/I&gt;&lt;/STRONG&gt;(&amp;amp;NumOfDatasets)) from Both;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; index = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%to&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;NumOfDatasets;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; index = &amp;amp;index;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; NumofDatasets = &amp;amp;NumofDatasets;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; XDataset1 = &amp;amp;XDataset1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; XDataset2 = &amp;amp;XDataset2; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; XDataset24 = &amp;amp;XDataset24; &lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; XDataset-index = &amp;amp;&amp;amp;XDataset&amp;amp;index&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Data Two;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;set &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%unquote&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(&amp;amp;importlibrary2)&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%unquote&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(&amp;amp;XDataset&amp;amp;index);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;ChkCombine&lt;/I&gt;&lt;/STRONG&gt;(ImportLibrary2=in2002,ImportLibrary3=in2003);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;And here is the Log&lt;/P&gt;&lt;P&gt;397 %macro ChkCombine(ImportLibrary2=,ImportLibrary3=);&lt;/P&gt;&lt;P&gt;398 LIBNAME in1002 "&lt;FONT color="#800080" face="Courier New" size="2"&gt;C:\Users\&amp;lt;hidden&amp;gt;\SAS Files&lt;/FONT&gt;\B5201002_201709081643";&lt;/P&gt;&lt;P&gt;399 LIBNAME in1003 "&lt;FONT color="#800080" face="Courier New" size="2"&gt;C:\Users\&amp;lt;hidden&amp;gt;\SAS Files&lt;/FONT&gt;\B5201003_201710101208";&lt;/P&gt;&lt;P&gt;400 run;&lt;/P&gt;&lt;P&gt;401&lt;/P&gt;&lt;P&gt;402 proc sql;&lt;/P&gt;&lt;P&gt;403 select count(Name) into :NumOfDatasets from Both;&lt;/P&gt;&lt;P&gt;404 select Name into :XDataset1-:XDataset%trim(%left(&amp;amp;NumOfDatasets)) from Both;&lt;/P&gt;&lt;P&gt;405 quit;&lt;/P&gt;&lt;P&gt;406&lt;/P&gt;&lt;P&gt;407 %do index = 1 %to &amp;amp;NumOfDatasets;&lt;/P&gt;&lt;P&gt;408 %put index = &amp;amp;index;&lt;/P&gt;&lt;P&gt;409 %put NumofDatasets = &amp;amp;NumofDatasets;&lt;/P&gt;&lt;P&gt;410 %put XDataset1 = &amp;amp;XDataset1;&lt;/P&gt;&lt;P&gt;411 %put XDataset2 = &amp;amp;XDataset2;&lt;/P&gt;&lt;P&gt;412 %put XDataset24 = &amp;amp;XDataset24;&lt;/P&gt;&lt;P&gt;413 %put XDataset-index = &amp;amp;&amp;amp;XDataset&amp;amp;index&lt;/P&gt;&lt;P&gt;414 run;&lt;/P&gt;&lt;P&gt;415&lt;/P&gt;&lt;P&gt;416 Data Two;&lt;/P&gt;&lt;P&gt;417 set %unquote(&amp;amp;importlibrary2).%unquote(&amp;amp;XDataset&amp;amp;index);&lt;/P&gt;&lt;P&gt;418 run;&lt;/P&gt;&lt;P&gt;419&lt;/P&gt;&lt;P&gt;420 %end;&lt;/P&gt;&lt;P&gt;421 quit;&lt;/P&gt;&lt;P&gt;422&lt;/P&gt;&lt;P&gt;423 %mend;&lt;/P&gt;&lt;P&gt;424&lt;/P&gt;&lt;P&gt;425 %ChkCombine(ImportLibrary2=in2002,ImportLibrary3=in2003);&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): LIBNAME in1002 "&lt;FONT color="#800080" face="Courier New" size="2"&gt;C:\Users\&amp;lt;hidden&amp;gt;\SAS Files&lt;/FONT&gt;\B5201002_201709081643";&lt;/P&gt;&lt;P&gt;NOTE: Libref IN1002 was successfully assigned as follows:&lt;/P&gt;&lt;P&gt;Engine: V9&lt;/P&gt;&lt;P&gt;Physical Name: &lt;FONT color="#800080" face="Courier New" size="2"&gt;C:\Users\&amp;lt;hidden&amp;gt;\SAS Files&lt;/FONT&gt;\B5201002_201709081643&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): LIBNAME in1003 "&lt;FONT color="#800080" face="Courier New" size="2"&gt;C:\Users\&amp;lt;hidden&amp;gt;\SAS Files&lt;/FONT&gt;\B5201003_201710101208";&lt;/P&gt;&lt;P&gt;NOTE: Libref IN1003 was successfully assigned as follows:&lt;/P&gt;&lt;P&gt;Engine: V9&lt;/P&gt;&lt;P&gt;Physical Name: &lt;FONT color="#800080" face="Courier New" size="2"&gt;C:\Users\&amp;lt;hidden&amp;gt;\SAS Files&lt;/FONT&gt;\B5201003_201710101208&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): run;&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): proc sql;&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): select count(Name) into :NumOfDatasets from Both;&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): select Name into :XDataset1-:&lt;/P&gt;&lt;P&gt;MPRINT(TRIM): XDataset24&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): from Both;&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): quit;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.03 seconds&lt;/P&gt;&lt;P&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;index = 1&lt;/P&gt;&lt;P&gt;NumofDatasets = 24&lt;/P&gt;&lt;P&gt;XDataset1 = ADVERSE_SACQ&lt;/P&gt;&lt;P&gt;XDataset2 = CNTD_P_SACQ&lt;/P&gt;&lt;P&gt;XDataset24 = VITALS_SACQ&lt;/P&gt;&lt;P&gt;XDataset-index = ADVERSE_SACQ run&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): Data Two;&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference XDATASET not resolved.&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): set in2002.ADVERSE_SACQ;&lt;/P&gt;&lt;P&gt;ERROR: Libref IN2002 is not assigned.&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): run;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;WARNING: The data set WORK.TWO may be incomplete. When this step was stopped there were 0&lt;/P&gt;&lt;P&gt;observations and 0 variables.&lt;/P&gt;&lt;P&gt;WARNING: Data set WORK.TWO was not replaced because this step was stopped.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.00 seconds&lt;/P&gt;&lt;P&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;index = 2&lt;/P&gt;&lt;P&gt;NumofDatasets = 24&lt;/P&gt;&lt;P&gt;XDataset1 = ADVERSE_SACQ&lt;/P&gt;&lt;P&gt;XDataset2 = CNTD_P_SACQ&lt;/P&gt;&lt;P&gt;XDataset24 = VITALS_SACQ&lt;/P&gt;&lt;P&gt;XDataset-index = CNTD_P_SACQ run&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): Data Two;&lt;/P&gt;&lt;P&gt;WARNING: Apparent symbolic reference XDATASET not resolved.&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): set in2002.CNTD_P_SACQ;&lt;/P&gt;&lt;P&gt;ERROR: Libref IN2002 is not assigned.&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): run;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;WARNING: The data set WORK.TWO may be incomplete. When this step was stopped there were 0&lt;/P&gt;&lt;P&gt;observations and 0 variables.&lt;/P&gt;&lt;P&gt;WARNING: Data set WORK.TWO was not replaced because this step was stopped.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.01 seconds&lt;/P&gt;&lt;P&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 17:09:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408109#M19698</guid>
      <dc:creator>JamesH</dc:creator>
      <dc:date>2017-10-27T17:09:24Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not being read...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408111#M19699</link>
      <description>&lt;P&gt;&lt;SPAN&gt;I didn't look closely, but it might be the single ampersand here.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;amp;XDataset&amp;amp;index&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Oct 2017 17:12:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408111#M19699</guid>
      <dc:creator>WarrenKuhfeld</dc:creator>
      <dc:date>2017-10-27T17:12:43Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not being read...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408113#M19700</link>
      <description>&lt;P&gt;This doesn't answer your question but you can simplify your code here:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
select count(Name) into :NumOfDatasets from Both;
select Name into :XDataset1-:XDataset%trim(%left(&amp;amp;NumOfDatasets)) from Both;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;

select Name into :XDataset1-
 from Both;
quit;

%let NumOfDatasets = &amp;amp;sqlobs;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Oct 2017 17:17:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408113#M19700</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-10-27T17:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not being read...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408115#M19701</link>
      <description>&lt;P&gt;Make sure to reference it consistently.&amp;nbsp; If you want to add a suffix and the evaluate the generated macro variable name then you need to use &amp;amp;&amp;amp;.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data two;
  set &amp;amp;importlibrary2..&amp;amp;&amp;amp;XDataset&amp;amp;index..;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Also let PROC SQL count the number of datasets for you.&amp;nbsp; No need to run the query twice to get the count.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select Name
  into :XDataset1-
  from Both
;
%let NumOfDatasets=&amp;amp;sqlobs;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Oct 2017 17:21:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408115#M19701</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-10-27T17:21:01Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not being read...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408207#M19710</link>
      <description>Also, look at line 413 in your log and then at the result of the %PUT in the log:&lt;BR /&gt;XDataset-index = ADVERSE_SACQ run&lt;BR /&gt;&lt;BR /&gt;--this looks like your %PUT statement is missing a semi-colon and that the string 'run' is being taken as part of the value of your macro variable.&lt;BR /&gt;&lt;BR /&gt;Cynthia</description>
      <pubDate>Sat, 28 Oct 2017 00:44:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408207#M19710</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2017-10-28T00:44:44Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not being read...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408609#M19716</link>
      <description>&lt;P&gt;Thank you - sometimes its hard to break old habits &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 12:06:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408609#M19716</guid>
      <dc:creator>JamesH</dc:creator>
      <dc:date>2017-10-30T12:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not being read...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408614#M19717</link>
      <description>&lt;P&gt;Thank you.&amp;nbsp;&amp;nbsp; Good catch...&amp;nbsp;&amp;nbsp; That missing semicolon was a last minute add while trying to find where things were going wrong...&amp;nbsp; Fixed.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 12:18:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408614#M19717</guid>
      <dc:creator>JamesH</dc:creator>
      <dc:date>2017-10-30T12:18:15Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not being read...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408622#M19718</link>
      <description>&lt;P&gt;Thank you...&amp;nbsp;&amp;nbsp; While the double ampersand is the correct form, it isn't the main problem....I had been testing&amp;nbsp;a bunch of different&amp;nbsp;ways - including different number of ampersands,&amp;nbsp;before resorting to posting here - and that was the last test...&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 12:26:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408622#M19718</guid>
      <dc:creator>JamesH</dc:creator>
      <dc:date>2017-10-30T12:26:55Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not being read...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408660#M19719</link>
      <description>&lt;P&gt;UPDATE:&lt;BR /&gt;&lt;BR /&gt;I got the macro variables working correctly, but the problem is the library is not being defined in the macro...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the macro above:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data Two;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;set &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%unquote&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(&amp;amp;importlibrary2)&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%unquote&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(&amp;amp;XDataset&amp;amp;index);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ERROR: Libref IN2002 is not assigned.&lt;BR /&gt;&lt;BR /&gt;I've read this is a problem with the LIBNAME needing the In2002 to be a global variable, but the solution is to put that into the autoexec.sas...&amp;nbsp;&amp;nbsp; The problem is I don't have access to edit my autoexec.sas on my work pc...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have a workaround?&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 13:50:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408660#M19719</guid>
      <dc:creator>JamesH</dc:creator>
      <dc:date>2017-10-30T13:50:56Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not being read...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408681#M19720</link>
      <description>&lt;P&gt;I really don't understand the question.&lt;/P&gt;
&lt;P&gt;Normally it is the user of the macro that tells the macro what to do.&amp;nbsp; So if you want the macro to read from a libref named FRED then make sure you have created FRED before you call the macro.&amp;nbsp; Or tell it to use a different libref that does exist.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Say I had a macro named MYMACRO that took as one of its parameters INLIB which should contain the name of the library that it shoudl read from. Then my calling program would look something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;libname mylib '/mypath';
%mymacro(inlib=mylib);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Oct 2017 14:17:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408681#M19720</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-10-30T14:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not being read...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408792#M19726</link>
      <description>&lt;P&gt;Heres the full macro (modified slightly from above)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought it wasn't reading the value of &amp;amp;&amp;amp;xdataset{index}, but that got fixed...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;its just not processing in1002&amp;nbsp;&amp;nbsp; (I added the two libnames as a last resort - it didn't work either way)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%macro&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; ChkCombine(ImportLibrary2=,ImportLibrary3=);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;LIBNAME in1002 &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"C:\Users\xxxx\Desktop\Studies\B520xxxx\SAS Files\B5201002_201709081643"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;LIBNAME in1003 &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"C:\Users\xxxx\Desktop\Studies\B520xxxx\SAS Files\B5201003_201710101208"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;select count(Name) into :NumOfDatasets from Both;&lt;/P&gt;&lt;P&gt;select Name into :XDataset1-:XDataset%&lt;STRONG&gt;&lt;I&gt;trim&lt;/I&gt;&lt;/STRONG&gt;(%&lt;STRONG&gt;&lt;I&gt;left&lt;/I&gt;&lt;/STRONG&gt;(&amp;amp;NumOfDatasets)) from Both;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%do&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; index = &lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;1&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%to&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; &amp;amp;NumOfDatasets;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; index = &amp;amp;index;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; NumofDatasets = &amp;amp;NumofDatasets;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%put&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt; XDataset-index = &amp;amp;&amp;amp;XDataset&amp;amp;index;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;Data Two;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;set &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%unquote&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(&amp;amp;&amp;amp;importlibrary2)&lt;/FONT&gt;&lt;STRONG&gt;&lt;FONT color="#008080" face="Courier New" size="2"&gt;.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%unquote&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;(&amp;amp;&amp;amp;XDataset&amp;amp;index);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#0000ff" face="Courier New" size="2"&gt;%end&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#000080" face="Courier New" size="2"&gt;&lt;STRONG&gt;%mend&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;%&lt;STRONG&gt;&lt;I&gt;ChkCombine&lt;/I&gt;&lt;/STRONG&gt;(ImportLibrary2=in2002,ImportLibrary3=in2003);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): LIBNAME in1002 "C:\Users\xxxx\Desktop\Studies\B520xxxx\SAS&lt;/P&gt;&lt;P&gt;Files\B5201002_201709081643";&lt;/P&gt;&lt;P&gt;NOTE: Libref IN1002 was successfully assigned as follows:&lt;/P&gt;&lt;P&gt;Engine: V9&lt;/P&gt;&lt;P&gt;Physical Name: C:\Users\hannoj05\Desktop\Studies\B520xxxx\SAS Files\B5201002_201709081643&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): LIBNAME in1003 "C:\Users\xxxx\Desktop\Studies\B520xxxx\SAS&lt;/P&gt;&lt;P&gt;Files\B5201003_201710101208";&lt;/P&gt;&lt;P&gt;NOTE: Libref IN1003 was successfully assigned as follows:&lt;/P&gt;&lt;P&gt;Engine: V9&lt;/P&gt;&lt;P&gt;Physical Name: C:\Users\xxxx\Desktop\Studies\B520xxxx\SAS Files\B5201003_201710101208&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): run;&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): proc sql;&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): select count(Name) into :NumOfDatasets from Both;&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): select Name into :XDataset1-:&lt;/P&gt;&lt;P&gt;MPRINT(TRIM): XDataset24&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): from Both;&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): quit;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.03 seconds&lt;/P&gt;&lt;P&gt;cpu time 0.00 seconds&lt;/P&gt;&lt;P&gt;　&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;index = 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NumofDatasets = 24&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;XDataset-index = ADVERSE_SACQ&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): run;&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): Data Two;&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): set in2002.ADVERSE_SACQ;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT color="#ff0000"&gt;ERROR: Libref IN2002 is not assigned.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;MPRINT(CHKCOMBINE): run;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;WARNING: The data set WORK.TWO may be incomplete. When this step was stopped there were 0&lt;/P&gt;&lt;P&gt;observations and 0 variables.&lt;/P&gt;&lt;P&gt;WARNING: Data set WORK.TWO was not replaced because this step was stopped.&lt;/P&gt;&lt;P&gt;NOTE: DATA statement used (Total process time):&lt;/P&gt;&lt;P&gt;real time 0.01 seconds&lt;/P&gt;&lt;P&gt;cpu time 0.01 seconds&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 16:53:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408792#M19726</guid>
      <dc:creator>JamesH</dc:creator>
      <dc:date>2017-10-30T16:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Macro variable not being read...</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408795#M19727</link>
      <description>&lt;P&gt;UPDATE IT WORKED!!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks to&amp;nbsp;my last message to Tom explaining what I did, I threw caution to the wind and did this mod to the macro....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;LIBNAME &amp;amp;importlibrary2 &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"C:\Users\xxxx\Desktop\Studies\B520xxxx\SAS Files\B5201002_201709081643"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;LIBNAME &amp;amp;importlibrary3 &lt;/FONT&gt;&lt;FONT color="#800080" face="Courier New" size="2"&gt;"C:\Users\xxxx\Desktop\Studies\B520xxxx\SAS Files\B5201003_201710101208"&lt;/FONT&gt;&lt;FONT face="Courier New" size="2"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Apparently the macro variable&amp;nbsp;@importlibrary2 was not perfectly equal to in2002....&amp;nbsp;&amp;nbsp; But using the exact same definition, it worked fine...&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="Courier New" size="2"&gt;Thank you to everyone who helped!&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Oct 2017 16:58:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/Macro-variable-not-being-read/m-p/408795#M19727</guid>
      <dc:creator>JamesH</dc:creator>
      <dc:date>2017-10-30T16:58:01Z</dc:date>
    </item>
  </channel>
</rss>

