<?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: DS2 create post call rest out in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/DS2-create-post-call-rest-out/m-p/647459#M193793</link>
    <description>&lt;P&gt;Your package contains an overloaded definition for the createPost method. One of the methods requires 5 parameters, the other 7:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;method createPost(nvarchar(16384) url, int timeout, nvarchar(256) userid, nvarchar(256) password, in_out int rc);
method createPost(nvarchar(16384) url, nvarchar(16384) contentType, nvarchar(16384) accept, int timeout, nvarchar(256) userid, nvarchar(256) password, in_out int rc);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;When you call the method in your code, DS2 looks for a method definition that has the same number of parameters. Your method call looks like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;scbQuery.createPost( 'https://hooks.slack.com/services/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');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Because your method call only provides &lt;EM&gt;one&amp;nbsp;&lt;/EM&gt; parameter value, there is no method definition in the package that matches that pattern, and DS2 throws the error:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;ERROR: Line 84: No method declaration for method createpost matches the given argument list.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Your call to the executePost method has the same problem, resulting in the error:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;ERROR: Line 85: No method declaration for method executepost matches the given argument list.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;When you call a method in a DS2 data program, you must provide values for all parameters in order to execute the method without error.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 13 May 2020 13:24:20 GMT</pubDate>
    <dc:creator>SASJedi</dc:creator>
    <dc:date>2020-05-13T13:24:20Z</dc:date>
    <item>
      <title>DS2 create post call rest out</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DS2-create-post-call-rest-out/m-p/647447#M193789</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm facing a problem while trying to create a code&amp;nbsp;DS2&amp;nbsp; to create&amp;nbsp; and execute a post this is my code :&lt;/P&gt;&lt;PRE&gt;proc ds2;

data test / overwrite=yes;

/*dcl varchar(65000) response;*/

method init();

dcl package tap_restcallout scbQuery();

dcl integer rc sc;


rc=scbQuery.createPost( 'https://hooks.slack.com/services/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');



sc=scbQuery.executePost(payload={"text": "tttttt"});



put 'RC=' rc;

put 'SC= ' sc;



end;

enddata;

run;

quit;

&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please find in attachement the code SAS DS2 for the package tap_restcallout&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Log&lt;/STRONG&gt;:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="sasSource"&gt;OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;72&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;73 proc ds2;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;74&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;75 data test / overwrite=yes;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;76&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;77 /*dcl varchar(65000) response;*/&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;78&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;79 method init();&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;80&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;81 dcl package tap_restcallout scbQuery();&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;82&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;83 dcl integer rc sc;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;84 rc=scbQuery.createPost( '&lt;A href="https://hooks.slack.com/services/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" target="_blank" rel="noopener"&gt;https://hooks.slack.com/services/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&lt;/A&gt;');&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;85 sc=scbQuery.executePost(payload={"text": "tttttt"});&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;86 put 'RC=' rc;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;87 put 'SC= ' sc;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;88&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;89&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;90&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;91 end;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;92&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;93 enddata;&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;94&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;95 run;&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: Compilation error.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: Line 84: No method declaration for method createpost matches the given argument list.&lt;/DIV&gt;&lt;DIV class="sasError"&gt;ERROR: Line 85: No method declaration for method executepost matches the given argument list.&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;NOTE: PROC DS2 has set option NOEXEC and will continue to prepare statements.&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;96&lt;/DIV&gt;&lt;DIV class="sasSource"&gt;97 quit;&lt;/DIV&gt;&lt;DIV class="sasNote"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 12:36:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DS2-create-post-call-rest-out/m-p/647447#M193789</guid>
      <dc:creator>zinabenammar</dc:creator>
      <dc:date>2020-05-13T12:36:01Z</dc:date>
    </item>
    <item>
      <title>Re: DS2 create post call rest out</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DS2-create-post-call-rest-out/m-p/647459#M193793</link>
      <description>&lt;P&gt;Your package contains an overloaded definition for the createPost method. One of the methods requires 5 parameters, the other 7:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;method createPost(nvarchar(16384) url, int timeout, nvarchar(256) userid, nvarchar(256) password, in_out int rc);
method createPost(nvarchar(16384) url, nvarchar(16384) contentType, nvarchar(16384) accept, int timeout, nvarchar(256) userid, nvarchar(256) password, in_out int rc);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;When you call the method in your code, DS2 looks for a method definition that has the same number of parameters. Your method call looks like this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;scbQuery.createPost( 'https://hooks.slack.com/services/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');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Because your method call only provides &lt;EM&gt;one&amp;nbsp;&lt;/EM&gt; parameter value, there is no method definition in the package that matches that pattern, and DS2 throws the error:&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;ERROR: Line 84: No method declaration for method createpost matches the given argument list.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Your call to the executePost method has the same problem, resulting in the error:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;SPAN&gt;ERROR: Line 85: No method declaration for method executepost matches the given argument list.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;When you call a method in a DS2 data program, you must provide values for all parameters in order to execute the method without error.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 13:24:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DS2-create-post-call-rest-out/m-p/647459#M193793</guid>
      <dc:creator>SASJedi</dc:creator>
      <dc:date>2020-05-13T13:24:20Z</dc:date>
    </item>
    <item>
      <title>Re: DS2 create post call rest out</title>
      <link>https://communities.sas.com/t5/SAS-Programming/DS2-create-post-call-rest-out/m-p/647542#M193816</link>
      <description>&lt;P&gt;Both of the CreatePost methods in the code show 4 or more arguments. Your call in the code&lt;/P&gt;
&lt;PRE&gt;rc=scbQuery.createPost( 'https://hooks.slack.com/services/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');&lt;/PRE&gt;
&lt;P&gt;uses only one.&lt;/P&gt;
&lt;P&gt;I don't do DS2 but that in a generic "number of parameters should match the parameters in the method call" way looks suspicious. Maybe you want another that only uses the URL??&lt;/P&gt;</description>
      <pubDate>Wed, 13 May 2020 17:21:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/DS2-create-post-call-rest-out/m-p/647542#M193816</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-05-13T17:21:20Z</dc:date>
    </item>
  </channel>
</rss>

