<?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: proc http  : getting error when executing an example from lexjansen in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-http-getting-error-when-executing-an-example-from-lexjansen/m-p/655502#M196648</link>
    <description>&lt;P&gt;Use another library in PROC FCMP, and set the COMPLIB= system option accordingly.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jun 2020 12:45:15 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2020-06-09T12:45:15Z</dc:date>
    <item>
      <title>proc http  : getting error when executing an example from lexjansen</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-http-getting-error-when-executing-an-example-from-lexjansen/m-p/655500#M196647</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;I am trying to learn how to execute an api call on sas 9.3 using an example from below document .&lt;/P&gt;
&lt;P&gt;But am getting the below error .&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when I checked online for the error , I am getting the resolution as changing the config file&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;C:\SAS\Lev1\SASApp\&lt;/STRONG&gt;&lt;SPAN&gt;sasv9.cfg&amp;nbsp;...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;is there another mothod to excute this proc http .&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.lexjansen.com/mwsug/2012/S1/MWSUG-2012-S110.pdf" target="_blank"&gt;https://www.lexjansen.com/mwsug/2012/S1/MWSUG-2012-S110.pdf&lt;/A&gt;&lt;/P&gt;
&lt;PRE&gt;%macro sas_getDist;

	data _null_;
		length url $ 2048;
		url = catt(
			'http://maps.googleapis.com/maps/api/directions/xml?origin=', &amp;amp;start,
			'&amp;amp;destination=', &amp;amp;end,
			'&amp;amp;sensor=false&amp;amp;alternatives=false');
		url = translate(trim(url), '+', ' ');
		call symputx('REQUEST_URL', url);
	run;

	FILENAME dist "\\Desktop\SAS\RESPONSE1.txt";

	proc http
		out = dist
		url = "%superq(REQUEST_URL)"
		method = "GET"
		ct = "application/x-www-form-urlencoded";
	run;

	filename xml_map "\\Desktop\SAS\google-maps-dist.map";
	libname dist xml xmlmap=xml_map;

	data _null_;
		set dist.distance;

		/* 1 mile = 1,609.344 meters */
		dist = dist / 1609.344;
		call symputx('DIST', dist);
	run;

%mend;

proc fcmp outlib=sasuser.funcs.web;
	function sas_getDist(start $, end $);
		rc = run_macro('sas_getDist', start, end, dist);
		return (dist);
	endsub;
quit;

data addresses;
	length name $ 32 address $ 128;
	infile datalines truncover;
	input name address $128.;
	datalines;
SAS SAS Campus Dr., Cary, NC 27513
YMCA 1603 Hillsborough St., Raleigh, NC 27605
NCSU Joyner Visitor Center, NC State University, Raleigh, NC 27695-7504
UNC-CH UNC Visitor Center, 250 East Franklin Street, Chapel Hill, NC
;

options cmplib=sasuser.funcs;

data distances;
	set addresses;
	dist = sas_getDist('SAS Campus Dr., Cary, NC, 27513', address);
run;

proc print data=addresses;
	where sas_getDist('SAS Campus Dr., Cary, NC, 27513', address) &amp;lt; 10;
run;
&lt;/PRE&gt;
&lt;PRE&gt;ERROR:

59         proc fcmp outlib=sasuser.funcs.web;
60         function sas_getDist(start $, end $);
61          rc = run_macro('sas_getDist', start, end, dist);
62          return (dist);
63         endsub;
64         quit;

ERROR: Write access to member SASUSER.FUNCS.DATA is denied.
WARNING: Failed to save function sas_getDist to sasuser.funcs.web.&lt;/PRE&gt;
&lt;PRE&gt;ERROR 2
--------------
WARNING: No CMP or C functions found in library sasuser.funcs.
79          dist = sas_getDist('SAS Campus Dr., Cary, NC, 27513', address);
                   ___________
                   68
ERROR 68-185: The function SAS_GETDIST is unknown, or cannot be accessed.&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Jun 2020 12:37:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-http-getting-error-when-executing-an-example-from-lexjansen/m-p/655500#M196647</guid>
      <dc:creator>dennis_oz</dc:creator>
      <dc:date>2020-06-09T12:37:43Z</dc:date>
    </item>
    <item>
      <title>Re: proc http  : getting error when executing an example from lexjansen</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-http-getting-error-when-executing-an-example-from-lexjansen/m-p/655502#M196648</link>
      <description>&lt;P&gt;Use another library in PROC FCMP, and set the COMPLIB= system option accordingly.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 12:45:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-http-getting-error-when-executing-an-example-from-lexjansen/m-p/655502#M196648</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-06-09T12:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: proc http  : getting error when executing an example from lexjansen</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-http-getting-error-when-executing-an-example-from-lexjansen/m-p/655515#M196654</link>
      <description>Sorry Kurt, I did not get you</description>
      <pubDate>Tue, 09 Jun 2020 13:25:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-http-getting-error-when-executing-an-example-from-lexjansen/m-p/655515#M196654</guid>
      <dc:creator>dennis_oz</dc:creator>
      <dc:date>2020-06-09T13:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: proc http  : getting error when executing an example from lexjansen</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-http-getting-error-when-executing-an-example-from-lexjansen/m-p/655549#M196670</link>
      <description>&lt;P&gt;This:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc fcmp outlib=sasuser.funcs.web;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;directs SAS to store the new function in a catalog in the SASUSER library; in your setup, this library is used in read-only mode.&lt;/P&gt;
&lt;P&gt;Similarly, this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;options cmplib=sasuser.funcs;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;tells SAS where to look for compiled functions. You need to use a different library for this; if you don't want the function to be permanently available, you can use WORK.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jun 2020 15:14:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-http-getting-error-when-executing-an-example-from-lexjansen/m-p/655549#M196670</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2020-06-09T15:14:29Z</dc:date>
    </item>
  </channel>
</rss>

