全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2500 5
2013-09-13
/*1.建立目录 C:\temp*/
/*2.运行下面代码*/
%macro sas_getMap;
data _null_;
length url $ 2048;
url = catt(
'http://maps.googleapis.com/maps/api/staticmap?markers=', urlencode(&address),
'&zoom=15',
'&size=', &height, 'x', &width,
'&sensor=false');
url = transtrn(trim(url), ' ', '%20');
call symputx('REQUEST_URL', url);
run;
filename img_fref &img_filename;
filename hdr_out "c:\temp\header.txt";
proc http
out = img_fref
url = "%superq(REQUEST_URL)"
headerout = hdr_out
method = "GET"
ct="application/x-www-form-urlencoded"
;
run;
data _null_;
infile hdr_out;
input;
if prxmatch('/^HTTP\/\S+\s+\d+/', _infile_);
status = scan(_infile_, 2, ' ');
if status = '200' then
call symputx('STATUS', 0);
else
call symputx('STATUS', status);
stop;
run;
%mend;


proc fcmp outlib=sasuser.funcs.web;
function sas_getMap(address $, height, width, img_filename $);
length status 8;
rc = run_macro('sas_getMap', address, height, width, img_filename, status);
return (status);
endsub;
quit;


data addresses;
length name $ 32 address $ 50;
infile datalines truncover;
input name address $128.;
datalines;
SCUT south china university of technology
;
run;
options cmplib=sasuser.funcs;
data _null_;
set addresses;
/* <Imagine report generation code here> */
rc = sas_getMap(address, 800, 600, catt('c:\temp\', name, '.png'));
if rc then
putlog 'ERROR: Could not get map for ' name;
run;


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2013-9-18 11:00:53
这是做什么呢!
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-10-9 23:57:35
干神马的?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-10-11 17:00:38
运行了一下,是利用google搜寻地址然后下载地址图片的程序,蛮好的
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-10-12 12:21:07
ERROR: PROCEDURE HTTP 没有找到。
ERROR: 物理文件不存在,c:\temp\header.txt。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2013-10-14 09:24:33
2433 发表于 2013-10-12 12:21
ERROR: PROCEDURE HTTP 没有找到。
ERROR: 物理文件不存在,c:\temp\header.txt。
It only support version SAS9.3 or higher..
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群