<?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: Execute SAS Program via VBA: specifying port number &amp;gt; max int in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Execute-SAS-Program-via-VBA-specifying-port-number-gt-max-int/m-p/479765#M123878</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32246"&gt;@ChrisBrooks&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;I suspect the problem lies with the port attribute of the serverdef object which is supplied by SAS and not the variable&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/221923"&gt;@Andy_D&lt;/a&gt;&amp;nbsp;is using to hold the port number.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Like I implied, that was a guess. But I follow your idea and it makes a lot of sense.&lt;/P&gt;</description>
    <pubDate>Thu, 19 Jul 2018 23:52:28 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-07-19T23:52:28Z</dc:date>
    <item>
      <title>Execute SAS Program via VBA: specifying port number &gt; max int</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Execute-SAS-Program-via-VBA-specifying-port-number-gt-max-int/m-p/479441#M123777</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I've just stumbled across this thread and would appreciate any help with the below problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to connect to a remote SAS server using the below code in VBA&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Public obSAS As sas.Workspace&lt;BR /&gt;&amp;nbsp;Public obWorkspaceManager As New SASWorkspaceManager.WorkspaceManager&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Sub sas_connect()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obConnection As New ADODB.Connection&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obRecordSet As New ADODB.Recordset&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim obServerDef As New SASWorkspaceManager.ServerDef&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim xmlString As String&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim sourcebuffer As String&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obServerDef.Port =&amp;nbsp;Port Number&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obServerDef.Protocol = ProtocolBridge&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; obServerDef.MachineDNSName =&amp;nbsp;Company&amp;nbsp;Name&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set obSAS = obWorkspaceManager.Workspaces.CreateWorkspaceByServer(Name, VisibilityProcess, obServerDef, Username, Password, xmlString)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;End Sub&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When assigning the port number in&amp;nbsp;VBA the maximum integer is 32767 (32-bit integer), but the port number I use to connect my profile to the remote SAS server is higher than this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance,&lt;/P&gt;
&lt;P&gt;Andy&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 12:18:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Execute-SAS-Program-via-VBA-specifying-port-number-gt-max-int/m-p/479441#M123777</guid>
      <dc:creator>Andy_D</dc:creator>
      <dc:date>2018-07-19T12:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: Execute SAS Program via VBA: specifying port number &gt; max int</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Execute-SAS-Program-via-VBA-specifying-port-number-gt-max-int/m-p/479759#M123874</link>
      <description>&lt;P&gt;32767 looks more like a 16 bit integer (with one bit reserved for sign).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Long time since I did anything with VBA and never did anything with ports but I would try making&amp;nbsp;the variable holding the port either a double or possibly string and see if that passes.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 23:22:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Execute-SAS-Program-via-VBA-specifying-port-number-gt-max-int/m-p/479759#M123874</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-19T23:22:17Z</dc:date>
    </item>
    <item>
      <title>Re: Execute SAS Program via VBA: specifying port number &gt; max int</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Execute-SAS-Program-via-VBA-specifying-port-number-gt-max-int/m-p/479762#M123875</link>
      <description>&lt;P&gt;I don't have access to a machine with SAS IOM installed at the moment so I can't check any of this but I think, with a little educated guesswork, I know what is happening here. It may be a little bit esoteric but bear with me......&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Firstly some definitions:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;A 16 bit unsigned integer can contain values&amp;nbsp;&lt;SPAN&gt;0 through 65,535;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;A 16 bit signed integer can contain values&amp;nbsp;-32,768 through 32,767;&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;A 32 bit&amp;nbsp;&lt;/SPAN&gt;unsigned integer can contain values&amp;nbsp;&lt;SPAN&gt;0 through 4,294,967,295; and&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;A 32 bit signed integer can contain values&amp;nbsp;-2,147,483,648 through 2,147,483,647&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;&lt;SPAN&gt;Port numbers range from 0 to 65535 with numbers 1 to 1024 reserved.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I suspect that the port attribute of the&amp;nbsp;&lt;/SPAN&gt;serverdef object supplied by SAS is actually a 16 bit signed integer which is why&amp;nbsp;you cannot use port numbers greater than 32767 (in my experience there are usually plenty of ports available within this limit).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are two ways&amp;nbsp;to overcome this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Persuade SAS to change the port attribute to an unsigned 16 bit integer (you can't have negative port numbers) - however I suspect you will have little luck with that; or&lt;/LI&gt;
&lt;LI&gt;Change the port you are using so that it is within the 32767 limit for a signed 16 bit integer&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Is there any reason you can't use a port within that limit as I would be amazed to find there were none free?&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 23:37:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Execute-SAS-Program-via-VBA-specifying-port-number-gt-max-int/m-p/479762#M123875</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2018-07-19T23:37:44Z</dc:date>
    </item>
    <item>
      <title>Re: Execute SAS Program via VBA: specifying port number &gt; max int</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Execute-SAS-Program-via-VBA-specifying-port-number-gt-max-int/m-p/479763#M123876</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;I suspect the problem lies with the port attribute of the serverdef object which is supplied by SAS and not the variable&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/221923"&gt;@Andy_D&lt;/a&gt;&amp;nbsp;is using to hold the port number.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 23:39:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Execute-SAS-Program-via-VBA-specifying-port-number-gt-max-int/m-p/479763#M123876</guid>
      <dc:creator>ChrisBrooks</dc:creator>
      <dc:date>2018-07-19T23:39:47Z</dc:date>
    </item>
    <item>
      <title>Re: Execute SAS Program via VBA: specifying port number &gt; max int</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Execute-SAS-Program-via-VBA-specifying-port-number-gt-max-int/m-p/479765#M123878</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/32246"&gt;@ChrisBrooks&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13884"&gt;@ballardw&lt;/a&gt;&amp;nbsp;I suspect the problem lies with the port attribute of the serverdef object which is supplied by SAS and not the variable&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/221923"&gt;@Andy_D&lt;/a&gt;&amp;nbsp;is using to hold the port number.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Like I implied, that was a guess. But I follow your idea and it makes a lot of sense.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Jul 2018 23:52:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Execute-SAS-Program-via-VBA-specifying-port-number-gt-max-int/m-p/479765#M123878</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-07-19T23:52:28Z</dc:date>
    </item>
    <item>
      <title>Re: Execute SAS Program via VBA: specifying port number &gt; max int</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Execute-SAS-Program-via-VBA-specifying-port-number-gt-max-int/m-p/479837#M123912</link>
      <description>&lt;P&gt;Thanks Chris - Think I'll have to contact the admin in order to find out if any other ports within the 16-bit integer range have been assigned to the host server which we use.&lt;/P&gt;</description>
      <pubDate>Fri, 20 Jul 2018 09:00:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Execute-SAS-Program-via-VBA-specifying-port-number-gt-max-int/m-p/479837#M123912</guid>
      <dc:creator>Andy_D</dc:creator>
      <dc:date>2018-07-20T09:00:53Z</dc:date>
    </item>
  </channel>
</rss>

