楼主: zhou.wen
2556 5

[程序分享] http in sas [推广有奖]

已卖:4460份资源

教授

9%

还不是VIP/贵宾

-

TA的文库  其他...

SAS Technology

威望
0
论坛币
31987 个
通用积分
6.2141
学术水平
283 点
热心指数
262 点
信用等级
257 点
经验
56058 点
帖子
396
精华
4
在线时间
1328 小时
注册时间
2010-10-12
最后登录
2018-3-9

初级学术勋章 初级热心勋章 中级学术勋章 中级热心勋章

楼主
zhou.wen 发表于 2013-9-13 17:39:55 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币
/*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;


二维码

扫码加我 拉你入群

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

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

关键词:HTTP ttp Application University Technology address false null

已有 1 人评分学术水平 热心指数 信用等级 收起 理由
420948492 + 1 + 1 + 1 精彩帖子

总评分: 学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

Practice Is The Best Teacher!

沙发
妖帝东皇 发表于 2013-9-18 11:00:53
这是做什么呢!
┏━━━━━━━━━━━━━━┓
   ☞❤学而无友必然孤陋寡闻!❤
┗━━━━━━━━━━━━━━┛

藤椅
chinaeu 发表于 2013-10-9 23:57:35
干神马的?

板凳
420948492 发表于 2013-10-11 17:00:38
运行了一下,是利用google搜寻地址然后下载地址图片的程序,蛮好的
有人的地方就有江湖

报纸
2433 发表于 2013-10-12 12:21:07
ERROR: PROCEDURE HTTP 没有找到。
ERROR: 物理文件不存在,c:\temp\header.txt。

地板
zhou.wen 发表于 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..
Practice Is The Best Teacher!

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-4 18:12