| Date: | Mon, 27 Jun 2011 22:47:13 -0700 |
| Reply-To: | vasanth s <vasanthz@GMAIL.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | vasanth s <vasanthz@GMAIL.COM> |
| Subject: | Re: PC SAS - Reading jpeg images. |
| In-Reply-To: | <201106272137.p5RKvgdN014333@waikiki.cc.uga.edu> |
| Content-Type: | text/plain; charset=ISO-8859-1 |
|---|
Many Many Thanks Arthur & Ya, simply great.!! :)
Both the solutions worked great for jpeg and jpg images.
My first query to SAS-L & it was good experience. :)
Thanks & Regards,
Vasanth.S
On Mon, Jun 27, 2011 at 2:37 PM, Arthur Tabachneck <art297@rogers.com>wrote:
> Ya,
>
> The method you suggested doesn't appear to work correctly for jpeg files.
> However, it ran quite quickly on my machine in downloading the gif file.
>
> Art
> -------
> On Mon, 27 Jun 2011 17:08:32 -0400, Ya Huang <ya.huang@AMYLIN.COM> wrote:
>
> >The following code works fine, I can get the sas-l logo downloaded, and
> >opened in MS picture manager. What puzzled me is why it took such long
> time
> >to get it done:
> >
> >1 filename www url 'http://listserv.uga.edu/images/top-nl.gif'
> RECFM=S;
> >2
> >3 data _null_;
> >4 infile www;
> >5 input;
> >6 file 'c:\temp\junk.gif' RECFM=F;
> >7 put _infile_;
> >8 run;
> >
> >NOTE: The infile WWW is:
> > Filename=http://listserv.uga.edu/images/top-nl.gif,
> > Local Host Name=V-YHUANG1,
> > Local Host IP addr=10.101.100.25,
> > Service Hostname Name=listserv.uga.edu,
> > Service IP addr=128.192.1.75,
> > Service Name=httpd,Service Portno=80,Lrecl=256,
> > Recfm=Strea
> >
> >NOTE: The file 'c:\temp\junk.gif' is:
> > Filename=c:\temp\junk.gif,
> > RECFM=F,LRECL=256,File Size (bytes)=0,
> > Last Modified=27Jun2011:14:04:24,
> > Create Time=27Jun2011:12:55:20
> >
> >NOTE: 28 records were read from the infile WWW.
> > The minimum record length was 230.
> > The maximum record length was 256.
> >NOTE: 28 records were written to the file 'c:\temp\junk.gif'.
> >NOTE: DATA statement used (Total process time):
> > real time 1:33.72
> > cpu time 0.04 seconds
> >
> >
> >On Mon, 27 Jun 2011 16:51:57 +0530, vasanth s <vasanthz@GMAIL.COM> wrote:
> >
> >>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
>
|