Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
Hello,
I am trying to have a jpeg image as input and then write it to output. But unable to do so.
Tried the below code,
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 end=eof;
input;
file 'c:\image.jpg';
put _infile_;
run;
The output file c:\image.jpg was a 4KB file & unable to open it, where as the original image was around 25 KB.
Please let me know your thoughts on reading a image fle.
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
A quick check of the SAS site seems to indicate you need SAS/ACCESS to properly handle image files. I've never had a need to manipulate one, so I don't know if this is true or not.
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
Hi Peter, Thanks for viewing & your thoughts.
I was able to get a solution to the problem from Listserv SAS group. The below codes work in getting a image from internet & store it on PC.
Adding the right RECFM did the trick.
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' RECFM=S;
data _null_;
infile www;
input;
file 'c:\temp\junk.jpeg' RECFM=F;
put _infile_;
run;
or
Code:
filename in url
'http://europe.nokia.com/PRODUCT_METADATA_0/Products/Phones/N-series/N9-
00/images/nokia_n9-00_black_main-overview.jpg';
filename out "c:\picture845.jpg";