<?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: Call VBS within SAS? in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Call-VBS-within-SAS/m-p/83846#M555</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No I don't have to use passwords.&amp;nbsp; Give it a try and see what happens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully someone will come along with more info.&amp;nbsp; There is also the online docs. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Jun 2012 22:50:08 GMT</pubDate>
    <dc:creator>data_null__</dc:creator>
    <dc:date>2012-06-14T22:50:08Z</dc:date>
    <item>
      <title>Call VBS within SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Call-VBS-within-SAS/m-p/83843#M552</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 a program that outputs excel files to a mapped drive but not all users of the program remember to map to the drive before running the program. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've found the following script on the net that automatically maps to the drive so my question is can I package this so it runs directly from SAS?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ideally I'd like it in a macro that picks up the users username and password. Script that works is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Dim objNetwork&lt;/P&gt;&lt;P&gt;Set objNetwork = WScript.CreateObject("WScript.Network")&lt;/P&gt;&lt;P&gt;strLocalDrive = "E:"&lt;/P&gt;&lt;P&gt;strUser = "userA"&lt;/P&gt;&lt;P&gt;strPassword = "passwordA"&lt;/P&gt;&lt;P&gt;strRemoteShare = "\\SERVER\etc\etc"&lt;/P&gt;&lt;P&gt;objNetwork.MapNetworkDrive strLocalDrive, strRemoteShare, False&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any help really appreciated.&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Steve,&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 20:10:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Call-VBS-within-SAS/m-p/83843#M552</guid>
      <dc:creator>SteveNZ</dc:creator>
      <dc:date>2012-06-14T20:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Call VBS within SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Call-VBS-within-SAS/m-p/83844#M553</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes you can call that script from within SAS. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However can't you just define a FILEREF using the same syntax \\SERVER\etc\etc.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 22:13:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Call-VBS-within-SAS/m-p/83844#M553</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-06-14T22:13:48Z</dc:date>
    </item>
    <item>
      <title>Re: Call VBS within SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Call-VBS-within-SAS/m-p/83845#M554</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Would that work? I assumed the drive would have to be mapped. Do you have any sample code that uses username and passwords?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'd rather use the filenale statement as I've discovered a few hooks in the above script since posting.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 22:33:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Call-VBS-within-SAS/m-p/83845#M554</guid>
      <dc:creator>SteveNZ</dc:creator>
      <dc:date>2012-06-14T22:33:20Z</dc:date>
    </item>
    <item>
      <title>Re: Call VBS within SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Call-VBS-within-SAS/m-p/83846#M555</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;No I don't have to use passwords.&amp;nbsp; Give it a try and see what happens.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hopefully someone will come along with more info.&amp;nbsp; There is also the online docs. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 22:50:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Call-VBS-within-SAS/m-p/83846#M555</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-06-14T22:50:08Z</dc:date>
    </item>
    <item>
      <title>Re: Call VBS within SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Call-VBS-within-SAS/m-p/83847#M556</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;First fix the program to write to whatever the user tells it to write to instead of assuming there is E: drive mapped.&amp;nbsp; What do users with 5 or more physical drives on their PCs do?&amp;nbsp; In your example you should be able to replace a path like "E:\myoutput.xls" with "&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;\\SERVER\etc\etc&lt;/SPAN&gt;\myoutput.xls".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Otherwise why not just use the &lt;STRONG&gt;net use&lt;/STRONG&gt; (&lt;A href="http://en.wikipedia.org/wiki/Net_use" title="http://en.wikipedia.org/wiki/Net_use"&gt;net use - Wikipedia, the free encyclopedia&lt;/A&gt;) command from the command prompt to map the drive instead of the VBS function call?&amp;nbsp; Is there something special about this drive that requires you to supply username and password?&amp;nbsp; Normally drives should just use the username and password of the user that is trying to connect to them.&amp;nbsp; If that works for you then you can use the system() function %SYSEXEC macro command or a filename with PIPE option to run the net use command from within your SAS program.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Jun 2012 23:37:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Call-VBS-within-SAS/m-p/83847#M556</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-06-14T23:37:09Z</dc:date>
    </item>
    <item>
      <title>Re: Call VBS within SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Call-VBS-within-SAS/m-p/83848#M557</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi @Tom,&lt;/P&gt;&lt;P&gt;Do you have an example I could adapt? I've never needed to look at this area before so am unfamiliar with code required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another option I thought of is using the drivemap option to see if the drive is mapped and, if not, sound an alert and not produce the files. I can easily do that but would prefer to get SAS to map the drive for the user.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cheers&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2012 00:10:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Call-VBS-within-SAS/m-p/83848#M557</guid>
      <dc:creator>SteveNZ</dc:creator>
      <dc:date>2012-06-15T00:10:49Z</dc:date>
    </item>
    <item>
      <title>Re: Call VBS within SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Call-VBS-within-SAS/m-p/83849#M558</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;This works for me to map my personal network folder to the J: drive letter. &lt;/P&gt;&lt;P&gt;The syntax might be different if you are using a different operating system.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;1&amp;nbsp;&amp;nbsp;&amp;nbsp; data _null_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; infile 'net use J: \\mopcitnas05\%username%$' pipe ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; put _infile_;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;5&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOTE: The infile 'net use J: \\mopcitnas05\%username%$' is:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Unnamed Pipe Access Device,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PROCESS=net use J: \\mopcitnas05\%username%$,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RECFM=V,LRECL=256&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;The command completed successfully.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOTE: 2 records were read from the infile 'net use J: \\mopcitnas05\%username%$'.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The minimum record length was 0.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The maximum record length was 35.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;NOTE: DATA statement used (Total process time):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 5.22 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.06 seconds&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2012 01:12:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Call-VBS-within-SAS/m-p/83849#M558</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2012-06-15T01:12:24Z</dc:date>
    </item>
    <item>
      <title>Re: Call VBS within SAS?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Call-VBS-within-SAS/m-p/83850#M559</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;Tom's idea worked ie:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;/TD&gt;&lt;TD&gt;data _null_;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; infile 'net use E: \\SERVER\etc\etc /user:username password' pipe ;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; input;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&amp;nbsp; &lt;/TD&gt;&lt;TD&gt; put _infile_;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for all the help&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 15 Jun 2012 01:39:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Call-VBS-within-SAS/m-p/83850#M559</guid>
      <dc:creator>SteveNZ</dc:creator>
      <dc:date>2012-06-15T01:39:22Z</dc:date>
    </item>
  </channel>
</rss>

