LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2011, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 27 Jun 2011 16:51:57 +0530
Reply-To:   vasanth s <vasanthz@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   vasanth s <vasanthz@GMAIL.COM>
Subject:   PC SAS - Reading jpeg images.
Content-Type:   text/plain; charset=ISO-8859-1

Hello All, I am trying to have a jpeg image from WWW as input and then store it in my PC. But unable to do so. Tried the below code,

filename www url ' http://europe.nokia.com/PRODUCT_METADATA_0/Products/Phones/N-series/N9-00/images/nokia_n9-00_black_main-overview.jpg';

data _null_; infile www url recfm=n; length byte $1; input byte $char1.; file 'c:\picture845.jpg' recfm=n; put byte $char1. @; run;

The output file c:\picture845.jpg was a 4KB file & unable to open it.. Whereas the original file on the WWW was 25KB.

Some other attempts that I have made to approach the above requirement are, *-> reading HTML data from a website & the code works fine,* Filename www url 'www.yahoo.com'; data _null_; infile www url end=eof; input; file 'c:\html.txt'; put _infile_; run;

*-> **Was able to successfully read an image stored locally and then store it locally in another place, using below code* filename picture 'C:\Documents and Settings\All Users\Documents\My Pictures\Sample Pictures\sunset.jpg'; data _null_; infile picture recfm=n; length byte $1; input byte $char1.; file 'c:\picture.jpg' recfm=n; put byte $char1. @; run;

Please let me know your thoughts on how to save a picture on the internet into local computer.

Thanks for viewing, Vasanth.S


Back to: Top of message | Previous page | Main SAS-L page