Reading XLS Image File using SAS

Reply
Contributor
Posts: 21

Reading XLS Image File using SAS

I have XLS file sheet 1 and sheet 2, sheet 1 has Image content and sheet 2 has data, I am trying use it using SFTP and copy it to other location/server, Image content getting corrupted when read  copied to other location, please help me in reading Image tab using SAS.

Valued Guide
Posts: 597

Re: Reading XLS Image File using SAS

Why don't you use WinSCP or similar open source FTP if you just want to copy files. If your using SAS to import/export file then I don't this image file can be handled by SAS.

Thanks,
Suryakiran
Contributor
Posts: 21

Re: Reading XLS Image File using SAS

Posted in reply to SuryaKiran

file name

expfile ref ftp  "& file.xls"  cd= path

 

 

When I am copying file to this location , its getting corrupted as the Xls file 1st tab has image file in it, please let me know if I can Use ODS to read the Image file. Thank you.

data _null_;
infile expfile NBYTE=n;
INPUT;
file "/serverpath/file.xls" recfm=n;
put _INFILE_ @@;
run;

Contributor
Posts: 21

How To Read XLS Image file using SAS?

Hi

 

I have to read/copy the  XLS file Sheet 1 having image content and sheet 2 having  records from source location, copy it to destination Location, while copying xls file at destination(SAS Server) the file getting corrupted, please could any one help me

 

 

 

file name

expfile ref ftp  "& file.xls"  cd= path

 

 

data _null_;
infile expfile NBYTE=n;
INPUT;
file "/serverpath/file.xls" recfm=n;
put _INFILE_ @@;
run;

Super User
Posts: 10,280

Re: Reading XLS Image File using SAS

You have to make sure that the SFTP client is set to binary mode, so that no changes are made to the file.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Contributor
Posts: 21

Re: Reading XLS Image File using SAS

Posted in reply to KurtBremser

SFTP code working fine but Image Xls file is getting copied to destination web  server, but XLS file getting corrupted as   it couldn't read imagetab.

Super User
Posts: 10,280

Re: Reading XLS Image File using SAS

If the image is not embedded, but only linked to, you need to embed it before you transfer the file.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 6 replies
  • 180 views
  • 0 likes
  • 3 in conversation