<?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 Connecting to amazon web service in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Connecting-to-amazon-web-service/m-p/35558#M7039</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In order to generate a key in SAS that uses sha256 or sha1 you need to license SAS/Secure software.&amp;nbsp; There are ways around this by using other programs.&amp;nbsp; The link you provided is for the FPS (Flexible Payments Service), which is not what you are actually trying to utilize based on the code above.&amp;nbsp; You are trying to interact with the AWSECommerceService.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the proper documentation for that API you are attempting to interact with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?RequestAuthenticationArticle.html"&gt;http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?RequestAuthenticationArticle.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should make sure you are using for proper secret keys first: &lt;A href="http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?ViewingCredentials.html"&gt;http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?ViewingCredentials.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The process you are missing is outlined here: &lt;A href="http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?rest-signature.html"&gt;http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?rest-signature.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to outsource this key generation to a different technology, for instance, perl...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Download perl here: &lt;A class="active_link" href="http://www.activestate.com/activeperl/downloads"&gt;http://www.activestate.com/activeperl/downloads&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Now you need to install the Digest::SHA::PurePerl module (There is another version that is faster but requires C/C++ compilers, this one should present you with fewer problems, unless you know what you are doing).&amp;nbsp; &lt;/P&gt;&lt;P&gt;In a command prompt window you want to type ppm install 'Digest::SHA::PurePerl'&lt;/P&gt;&lt;P&gt;If you encounter problems try this site: &lt;A href="http://www.activestate.com/blog/2010/10/how-install-cpan-modules-activeperl"&gt;http://www.activestate.com/blog/2010/10/how-install-cpan-modules-activeperl&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now that you have perl and the digest module installed you will want to create a perl script to call from SAS that will return the key you want.&amp;nbsp; It should look something like this: (note everything below is written quickly and not tested, at all)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#! usr/bin/perl&lt;/P&gt;&lt;P&gt;use FileHandle;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;open INFILE, '&amp;lt;', $ARGV[0] or die "error opening $ARGV[0]: $!";&lt;/P&gt;&lt;P&gt;my $data = do { local $/; &amp;lt;INFILE&amp;gt; };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use Digest::SHA::PurePerl qw(hmac_sha256_base64);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$digest=hmac_sha256_base64($data, $ARGV[1]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print $digest;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;close INFILE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From SAS you would want to call this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file 'C:\mytempfile' lrecl=5000 termstr=cr;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put 'GET';&lt;/P&gt;&lt;P&gt;&amp;nbsp; put 'ecs.amazonaws.com';&lt;/P&gt;&lt;P&gt;&amp;nbsp; put '/onca/xml';&lt;/P&gt;&lt;P&gt;&amp;nbsp; put 'AWSAccessKeyId=00000000000000000000&amp;amp;ItemId=0679722769&amp;amp;Operation=ItemLookup&amp;amp;ResponseGroup=ItemAttributes%2COffers%2CImages%2CReviews&amp;amp;Service=AWSECommerceService&amp;amp;Timestamp=20090101T12%3A00%3A00Z&amp;amp;Version=2009-01-06';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename key pipe 'C:\path\to\perlscript.pl C:\mytempfile myaws_secretkey';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data foo;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile key;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input key $;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you have what you need to build the full url including the HMAC-SHA Signature...&amp;nbsp; Of course a full and proper implementation of this will be much more complex.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 27 Oct 2011 00:46:24 GMT</pubDate>
    <dc:creator>FriedEgg</dc:creator>
    <dc:date>2011-10-27T00:46:24Z</dc:date>
    <item>
      <title>Connecting to amazon web service</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connecting-to-amazon-web-service/m-p/35555#M7036</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am trying to connect ot amazon web service form SAS but I can't find it how to generate the signature parameter. In their documentation, they say we need this HMAC-SHA256 parameter in the query. Do you have any code to generate it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://docs.amazonwebservices.com/AmazonFPS/latest/FPSAdvancedGuide/index.html?APPNDX_GeneratingaSignature.html"&gt;http://docs.amazonwebservices.com/AmazonFPS/latest/FPSAdvancedGuide/index.html?APPNDX_GeneratingaSignature.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Romain&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2011 22:23:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connecting-to-amazon-web-service/m-p/35555#M7036</guid>
      <dc:creator>mrom34</dc:creator>
      <dc:date>2011-10-26T22:23:09Z</dc:date>
    </item>
    <item>
      <title>Connecting to amazon web service</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connecting-to-amazon-web-service/m-p/35556#M7037</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;What are you trying to make this call from?&amp;nbsp; What SAS software do you license?&amp;nbsp; What OS is this running on?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2011 23:04:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connecting-to-amazon-web-service/m-p/35556#M7037</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-10-26T23:04:42Z</dc:date>
    </item>
    <item>
      <title>Connecting to amazon web service</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connecting-to-amazon-web-service/m-p/35557#M7038</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am just trying to play with the web service. I found this code and I believe it is not working because amazon added the signature parameter after this paper was released. I am using SAS 9.2 on win 7&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;filename amazon url "&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://ecs.amazonaws.com/onca/xml"&gt;http://ecs.amazonaws.com/onca/xml&lt;/A&gt;&lt;SPAN&gt;?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Service=AWSECommerceService&amp;amp;&lt;/P&gt;&lt;P&gt;AWSAccessKeyId= [Access Key ID]&amp;amp;&lt;/P&gt;&lt;P&gt;Operation=ItemLookup&amp;amp;&lt;/P&gt;&lt;P&gt;ItemId=B00008OE6I&amp;amp;&lt;/P&gt;&lt;P&gt;IdType=ASIN&amp;amp;"&lt;/P&gt;&lt;P&gt;lrecl=2000&lt;/P&gt;&lt;P&gt;recfm=S&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;data _null_ ;&lt;/P&gt;&lt;P&gt;infile amazon truncover;&lt;/P&gt;&lt;P&gt;input;&lt;/P&gt;&lt;P&gt;put _infile_;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Oct 2011 23:12:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connecting-to-amazon-web-service/m-p/35557#M7038</guid>
      <dc:creator>mrom34</dc:creator>
      <dc:date>2011-10-26T23:12:15Z</dc:date>
    </item>
    <item>
      <title>Connecting to amazon web service</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connecting-to-amazon-web-service/m-p/35558#M7039</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In order to generate a key in SAS that uses sha256 or sha1 you need to license SAS/Secure software.&amp;nbsp; There are ways around this by using other programs.&amp;nbsp; The link you provided is for the FPS (Flexible Payments Service), which is not what you are actually trying to utilize based on the code above.&amp;nbsp; You are trying to interact with the AWSECommerceService.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is the proper documentation for that API you are attempting to interact with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="active_link" href="http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?RequestAuthenticationArticle.html"&gt;http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?RequestAuthenticationArticle.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should make sure you are using for proper secret keys first: &lt;A href="http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?ViewingCredentials.html"&gt;http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?ViewingCredentials.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The process you are missing is outlined here: &lt;A href="http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?rest-signature.html"&gt;http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?rest-signature.html&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to outsource this key generation to a different technology, for instance, perl...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Download perl here: &lt;A class="active_link" href="http://www.activestate.com/activeperl/downloads"&gt;http://www.activestate.com/activeperl/downloads&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Now you need to install the Digest::SHA::PurePerl module (There is another version that is faster but requires C/C++ compilers, this one should present you with fewer problems, unless you know what you are doing).&amp;nbsp; &lt;/P&gt;&lt;P&gt;In a command prompt window you want to type ppm install 'Digest::SHA::PurePerl'&lt;/P&gt;&lt;P&gt;If you encounter problems try this site: &lt;A href="http://www.activestate.com/blog/2010/10/how-install-cpan-modules-activeperl"&gt;http://www.activestate.com/blog/2010/10/how-install-cpan-modules-activeperl&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now that you have perl and the digest module installed you will want to create a perl script to call from SAS that will return the key you want.&amp;nbsp; It should look something like this: (note everything below is written quickly and not tested, at all)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;#! usr/bin/perl&lt;/P&gt;&lt;P&gt;use FileHandle;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;open INFILE, '&amp;lt;', $ARGV[0] or die "error opening $ARGV[0]: $!";&lt;/P&gt;&lt;P&gt;my $data = do { local $/; &amp;lt;INFILE&amp;gt; };&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;use Digest::SHA::PurePerl qw(hmac_sha256_base64);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;$digest=hmac_sha256_base64($data, $ARGV[1]);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;print $digest;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;close INFILE;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From SAS you would want to call this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; file 'C:\mytempfile' lrecl=5000 termstr=cr;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put 'GET';&lt;/P&gt;&lt;P&gt;&amp;nbsp; put 'ecs.amazonaws.com';&lt;/P&gt;&lt;P&gt;&amp;nbsp; put '/onca/xml';&lt;/P&gt;&lt;P&gt;&amp;nbsp; put 'AWSAccessKeyId=00000000000000000000&amp;amp;ItemId=0679722769&amp;amp;Operation=ItemLookup&amp;amp;ResponseGroup=ItemAttributes%2COffers%2CImages%2CReviews&amp;amp;Service=AWSECommerceService&amp;amp;Timestamp=20090101T12%3A00%3A00Z&amp;amp;Version=2009-01-06';&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename key pipe 'C:\path\to\perlscript.pl C:\mytempfile myaws_secretkey';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data foo;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile key;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input key $;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now you have what you need to build the full url including the HMAC-SHA Signature...&amp;nbsp; Of course a full and proper implementation of this will be much more complex.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2011 00:46:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connecting-to-amazon-web-service/m-p/35558#M7039</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2011-10-27T00:46:24Z</dc:date>
    </item>
    <item>
      <title>Connecting to amazon web service</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Connecting-to-amazon-web-service/m-p/35559#M7040</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks a lot for this very detailled explanation!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Oct 2011 00:59:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Connecting-to-amazon-web-service/m-p/35559#M7040</guid>
      <dc:creator>mrom34</dc:creator>
      <dc:date>2011-10-27T00:59:22Z</dc:date>
    </item>
  </channel>
</rss>

