<?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 How can SAS macro variables be resolved in a VB script? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-can-SAS-macro-variables-be-resolved-in-a-VB-script/m-p/173757#M33349</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following SAS code which opens a specific file (PEOPLE_TEST.xml) and converts it to XLS.&lt;/P&gt;&lt;P&gt;However, the macro variables &amp;amp;path and &amp;amp;filename would not resolve when I open the vb script (PLIST.vbs).&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I would like to know how can the SAS macro variables resolve when the vb script is made. Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Here is the SAS code: */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;%let path = C:\Users\angelique.castaneda\Documents\Work\98_SAS References;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;%let filename = PEOPLE_TEST;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;%macro VB;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;DATA _NULL_; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;FILE "&amp;amp;path.\PLIST.vbs";&lt;/P&gt;&lt;P&gt;PUT 'Set objExcel = CreateObject("Excel.Application")'; &lt;/P&gt;&lt;P&gt;PUT 'objExcel.Visible = FALSE'; &lt;/P&gt;&lt;P&gt;PUT 'objExcel.DisplayAlerts = FALSE'; &lt;/P&gt;&lt;P&gt;PUT 'Set objWorkbook = objExcel.Workbooks.Open(""&amp;amp;path".\&amp;amp;filename..xml")';&lt;/P&gt;&lt;P&gt;PUT 'objExcel.ActiveWorkbook.SaveAs"&amp;amp;path.\&amp;amp;filename..xls",51'; &lt;/P&gt;&lt;P&gt;PUT 'objExcel.ActiveWorkbook.Close'; &lt;/P&gt;&lt;P&gt;PUT 'objExcel.Quit'; &lt;/P&gt;&lt;P&gt;RUN; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;%mend;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;%VB;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 17 Nov 2014 03:45:25 GMT</pubDate>
    <dc:creator>angeliquec</dc:creator>
    <dc:date>2014-11-17T03:45:25Z</dc:date>
    <item>
      <title>How can SAS macro variables be resolved in a VB script?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-SAS-macro-variables-be-resolved-in-a-VB-script/m-p/173757#M33349</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the following SAS code which opens a specific file (PEOPLE_TEST.xml) and converts it to XLS.&lt;/P&gt;&lt;P&gt;However, the macro variables &amp;amp;path and &amp;amp;filename would not resolve when I open the vb script (PLIST.vbs).&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;I would like to know how can the SAS macro variables resolve when the vb script is made. Thank you!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;Here is the SAS code: */&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;%let path = C:\Users\angelique.castaneda\Documents\Work\98_SAS References;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;%let filename = PEOPLE_TEST;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;%macro VB;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;DATA _NULL_; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;FILE "&amp;amp;path.\PLIST.vbs";&lt;/P&gt;&lt;P&gt;PUT 'Set objExcel = CreateObject("Excel.Application")'; &lt;/P&gt;&lt;P&gt;PUT 'objExcel.Visible = FALSE'; &lt;/P&gt;&lt;P&gt;PUT 'objExcel.DisplayAlerts = FALSE'; &lt;/P&gt;&lt;P&gt;PUT 'Set objWorkbook = objExcel.Workbooks.Open(""&amp;amp;path".\&amp;amp;filename..xml")';&lt;/P&gt;&lt;P&gt;PUT 'objExcel.ActiveWorkbook.SaveAs"&amp;amp;path.\&amp;amp;filename..xls",51'; &lt;/P&gt;&lt;P&gt;PUT 'objExcel.ActiveWorkbook.Close'; &lt;/P&gt;&lt;P&gt;PUT 'objExcel.Quit'; &lt;/P&gt;&lt;P&gt;RUN; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;%mend;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;%VB;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Nov 2014 03:45:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-SAS-macro-variables-be-resolved-in-a-VB-script/m-p/173757#M33349</guid>
      <dc:creator>angeliquec</dc:creator>
      <dc:date>2014-11-17T03:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: How can SAS macro variables be resolved in a VB script?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-can-SAS-macro-variables-be-resolved-in-a-VB-script/m-p/173758#M33350</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The two lines with macro variables are enclosed in single quotes, while macro variable won't resolve unless unquoted or ONLY surrounded by double quotes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is a way to do that directly using multiple sets of double quotes, or using something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;PUT 'Set objWorkbook = objExcel.Workbooks.Open("'@;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;PUT "&amp;amp;path.\&amp;amp;filename..xml"@;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;PUT '")';&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Nov 2014 05:10:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-can-SAS-macro-variables-be-resolved-in-a-VB-script/m-p/173758#M33350</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-11-17T05:10:26Z</dc:date>
    </item>
  </channel>
</rss>

