filename in "x:\temp\in"; filename out "x:\temp\out.txt"; %macro MakeTiny(longUrl=); data _null_; file in lrecl=1028; put "url=&longUrl" ; run; proc http in=in out=out url="http://tinyurl.com/api-create.php" method="post" ct="application/x-www-form-urlencoded"; run; data _null_ ; infile out; input tinyUrl :$1024. ; call symput('tinyUrl',tinyUrl); %global tinyUrl ; run; %mend makeTiny; %MakeTiny(longUrl=www.savian.net); %put &tinyUrl ;
This blog is designed to show various ways to use Data Virtualization, technologies, and SAS with Microsoft technologies with an eye toward outside of the box thinking.
Tuesday, December 27, 2011
SAS Macro to Make Tiny URLs
Someone on SAS-L wanted a piece of SAS code to convert a long url to a short one. Well, here you go:
Subscribe to:
Posts (Atom)
SAS throwing RPC error
If you are doing code in C# and get this error when creating a LanguageService: The RPC server is unavailable. (Exception from HRESULT:...
-
I was just tasked to read in LDAP records so we could cross-reference userids with login identifiers and general ledger information. Using...
-
I am finally ready with my SAS dataset reader/writer for .NET. It is written in 100% managed code using .NET 3.5. The dlls can be found here...
-
Well, around 14 months ago, I started on a journey to understand the SAS dataset so I could read and write one independently. Originally, I ...