<?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: SASEGScripting - entering parameter values in VB.Net in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-entering-parameter-values-in-VB-Net/m-p/672146#M36518</link>
    <description>&lt;P&gt;EG is written (a lot) in C#. FRirst of all, I suggest using C# in .NET vs VB.NET: it will make your life easier...and is a better language IMO.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's take a look at one piece of code in your program (converted to C#):&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;            // Date range: From Date and Thru Date
            // prm.Value = ?
            case "SVC_DT": // ProjectParmTypeDate(0)
                {
                    break;
                }&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The type is Date so it expects a date. .NET does not have a Date type so you need to use&amp;nbsp; a DateTime value. Hence, it needs to either be cast or converted. Sample C# code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;prm.Value = (DateTime)&amp;nbsp;&lt;CODE class=" language-sas"&gt;ProjectParmTypeDate(0);&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;...or...&lt;/CODE&gt;&lt;BR /&gt;prm.Value = DateTime.Parse(&lt;CODE class=" language-sas"&gt;ProjectParmTypeDate(0));&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;The&amp;nbsp;right-hand&amp;nbsp;side&amp;nbsp;of&amp;nbsp;the&amp;nbsp;equals&amp;nbsp;sign&amp;nbsp;needs&amp;nbsp;to&amp;nbsp;match&amp;nbsp;the&amp;nbsp;type&amp;nbsp;on&amp;nbsp;the&amp;nbsp;left.&amp;nbsp;.NET&amp;nbsp;(VB&amp;nbsp;or&amp;nbsp;C#),&amp;nbsp;are&amp;nbsp;strongly&amp;nbsp;typed&amp;nbsp;languages.&amp;nbsp;if&amp;nbsp;you&amp;nbsp;are&amp;nbsp;getting&amp;nbsp;your&amp;nbsp;parms&amp;nbsp;as&amp;nbsp;strings,&amp;nbsp;they&amp;nbsp;don't&amp;nbsp;fit&amp;nbsp;inside&amp;nbsp;of&amp;nbsp;a&amp;nbsp;DateTime.&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 24 Jul 2020 18:15:16 GMT</pubDate>
    <dc:creator>AlanC</dc:creator>
    <dc:date>2020-07-24T18:15:16Z</dc:date>
    <item>
      <title>SASEGScripting - entering parameter values in VB.Net</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-entering-parameter-values-in-VB-Net/m-p/671911#M36506</link>
      <description>&lt;P&gt;I’m writing a VB.Net program that uses SASEGScripting to populate parameter values and run SAS EG projects. The particular project I’m using for testing contains three different parameter types: “ProjectParamTypeString(5)”, "ProjectParamTypeString(0)", and "ProjectParamTypeDate(0)".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"ProjectParamTypeString(5)" is easy enough, I simply assign a string value to Project.Parameter(i).Value. How do I assign values to the other two types? Is there some documentation on ProjectParamTypes and how to use them in .Net?&lt;/P&gt;</description>
      <pubDate>Thu, 23 Jul 2020 18:29:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-entering-parameter-values-in-VB-Net/m-p/671911#M36506</guid>
      <dc:creator>jchamrad</dc:creator>
      <dc:date>2020-07-23T18:29:18Z</dc:date>
    </item>
    <item>
      <title>Re: SASEGScripting - entering parameter values in VB.Net</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-entering-parameter-values-in-VB-Net/m-p/672096#M36512</link>
      <description>In this case, “ProjectParamTypeString(5)” is a list of strings and "ProjectParamTypeDate(0)" is a date range.</description>
      <pubDate>Fri, 24 Jul 2020 14:17:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-entering-parameter-values-in-VB-Net/m-p/672096#M36512</guid>
      <dc:creator>jchamrad</dc:creator>
      <dc:date>2020-07-24T14:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: SASEGScripting - entering parameter values in VB.Net</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-entering-parameter-values-in-VB-Net/m-p/672099#M36513</link>
      <description>Correction: “ProjectParamTypeString(0)” is a list of strings</description>
      <pubDate>Fri, 24 Jul 2020 14:40:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-entering-parameter-values-in-VB-Net/m-p/672099#M36513</guid>
      <dc:creator>jchamrad</dc:creator>
      <dc:date>2020-07-24T14:40:14Z</dc:date>
    </item>
    <item>
      <title>Re: SASEGScripting - entering parameter values in VB.Net</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-entering-parameter-values-in-VB-Net/m-p/672119#M36515</link>
      <description>&lt;P&gt;Please post a section of code so it provides some context. I use C# but might be able to help if I can see the context that you are referring to.&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 15:37:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-entering-parameter-values-in-VB-Net/m-p/672119#M36515</guid>
      <dc:creator>AlanC</dc:creator>
      <dc:date>2020-07-24T15:37:45Z</dc:date>
    </item>
    <item>
      <title>Re: SASEGScripting - entering parameter values in VB.Net</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-entering-parameter-values-in-VB-Net/m-p/672129#M36516</link>
      <description>Here's the code where I fill in parameters. I'm able to fill in the simple strings but not the date ranges and string lists. I expect there are underlying object types for each but I haven't been able to discover what they are.&lt;BR /&gt;&lt;BR /&gt;Private Sub FillParams(ByRef params As SAS.EG.Scripting.ProjectParameterList)&lt;BR /&gt;For Each prm As SAS.EG.Scripting.ProjectParameter In params&lt;BR /&gt;Debug.WriteLine(prm.Name &amp;amp; " " &amp;amp; prm.Type.ToString &amp;amp; "(" &amp;amp; prm.Type &amp;amp; ")")&lt;BR /&gt;Select Case prm.Name&lt;BR /&gt;Case "uid" ' ProjectParmTypeString(5)&lt;BR /&gt;prm.Value = My.Settings.GalaxyUser&lt;BR /&gt;Case "upw_PASSWORD" ' ProjectParmTypeString(5)&lt;BR /&gt;prm.Value = My.Settings.GalaxyPw&lt;BR /&gt;Case "CSN" ' ProjectParmTypeString(5)&lt;BR /&gt;prm.Value = "'000188335'"&lt;BR /&gt;Case "PD_DT" ' ProjectParmTypeDate(0)&lt;BR /&gt;' Date range: From Date and Thru Date&lt;BR /&gt;' prm.Value = ?&lt;BR /&gt;Case "SVC_DT" ' ProjectParmTypeDate(0)&lt;BR /&gt;' Date range: From Date and Thru Date&lt;BR /&gt;' prm.Value = ?&lt;BR /&gt;Case "MY_NAME" ' ProjectParmTypeString(5)&lt;BR /&gt;prm.Value = "Lulu"&lt;BR /&gt;Case "DATABASE_SELECTION" ' ProjectParmTypeString(5)&lt;BR /&gt;' List of strings: "ABC","DEF","GHI"&lt;BR /&gt;' prm.Value = ?&lt;BR /&gt;End Select&lt;BR /&gt;Next&lt;BR /&gt;End Sub&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Jul 2020 16:21:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-entering-parameter-values-in-VB-Net/m-p/672129#M36516</guid>
      <dc:creator>jchamrad</dc:creator>
      <dc:date>2020-07-24T16:21:24Z</dc:date>
    </item>
    <item>
      <title>Re: SASEGScripting - entering parameter values in VB.Net</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-entering-parameter-values-in-VB-Net/m-p/672132#M36517</link>
      <description>Sorry, it re-formatted the code when I posted the reply.</description>
      <pubDate>Fri, 24 Jul 2020 16:24:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-entering-parameter-values-in-VB-Net/m-p/672132#M36517</guid>
      <dc:creator>jchamrad</dc:creator>
      <dc:date>2020-07-24T16:24:41Z</dc:date>
    </item>
    <item>
      <title>Re: SASEGScripting - entering parameter values in VB.Net</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-entering-parameter-values-in-VB-Net/m-p/672146#M36518</link>
      <description>&lt;P&gt;EG is written (a lot) in C#. FRirst of all, I suggest using C# in .NET vs VB.NET: it will make your life easier...and is a better language IMO.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let's take a look at one piece of code in your program (converted to C#):&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;            // Date range: From Date and Thru Date
            // prm.Value = ?
            case "SVC_DT": // ProjectParmTypeDate(0)
                {
                    break;
                }&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The type is Date so it expects a date. .NET does not have a Date type so you need to use&amp;nbsp; a DateTime value. Hence, it needs to either be cast or converted. Sample C# code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;prm.Value = (DateTime)&amp;nbsp;&lt;CODE class=" language-sas"&gt;ProjectParmTypeDate(0);&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;...or...&lt;/CODE&gt;&lt;BR /&gt;prm.Value = DateTime.Parse(&lt;CODE class=" language-sas"&gt;ProjectParmTypeDate(0));&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;The&amp;nbsp;right-hand&amp;nbsp;side&amp;nbsp;of&amp;nbsp;the&amp;nbsp;equals&amp;nbsp;sign&amp;nbsp;needs&amp;nbsp;to&amp;nbsp;match&amp;nbsp;the&amp;nbsp;type&amp;nbsp;on&amp;nbsp;the&amp;nbsp;left.&amp;nbsp;.NET&amp;nbsp;(VB&amp;nbsp;or&amp;nbsp;C#),&amp;nbsp;are&amp;nbsp;strongly&amp;nbsp;typed&amp;nbsp;languages.&amp;nbsp;if&amp;nbsp;you&amp;nbsp;are&amp;nbsp;getting&amp;nbsp;your&amp;nbsp;parms&amp;nbsp;as&amp;nbsp;strings,&amp;nbsp;they&amp;nbsp;don't&amp;nbsp;fit&amp;nbsp;inside&amp;nbsp;of&amp;nbsp;a&amp;nbsp;DateTime.&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Jul 2020 18:15:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-entering-parameter-values-in-VB-Net/m-p/672146#M36518</guid>
      <dc:creator>AlanC</dc:creator>
      <dc:date>2020-07-24T18:15:16Z</dc:date>
    </item>
    <item>
      <title>Re: SASEGScripting - entering parameter values in VB.Net</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-entering-parameter-values-in-VB-Net/m-p/672958#M36559</link>
      <description>I've been digging a little deeper and find that I may be asking the wrong question. In this particular project, the Parameters property of the Project object contains an entry named ‘PD_DT’. Turns out that ‘PD_DT’ refers to a Prompt. This prompt is defined as a ‘Date range’ with range type of ‘Custom’. In SAS EG, users are prompted for ‘From’ and ‘To’ dates. Where can I find this prompt in the Project object so I can enter the ‘From’ and ‘To’ dates programmatically ?</description>
      <pubDate>Tue, 28 Jul 2020 19:39:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/SASEGScripting-entering-parameter-values-in-VB-Net/m-p/672958#M36559</guid>
      <dc:creator>jchamrad</dc:creator>
      <dc:date>2020-07-28T19:39:22Z</dc:date>
    </item>
  </channel>
</rss>

