BookmarkSubscribeRSS Feed
jerry_h
Calcite | Level 5

The program in question reads an established list of Excel spreadsheets residing in a Linux directory.  The purpose of this step in the program is to pass a refined set of those file names to another location in Linux and then read them in, one at a time, for processing.  I have tried the following using DATA _NULL_;FILE...;PUT...;  It has not mattered if I allocate that file like /dir1/dir2/dir3/tempdir ro /dir1/dir2/dir3/tempdir/tempfile.dat.  If I use just the directory (temdir) SAS says it has written the files but there is nothing in the directory.  When I use the .dat approach, it does full that file but will not read it in proc import.  Any ideas?


2 REPLIES 2
Peter_C
Rhodochrosite | Level 12

pardon my lack of confident knowledge, but does proc import import from excel files on unix/linux?

Andre
Obsidian | Level 7

Hi Peter,

Yes this code is working under 9.2.3

filename s "~wi/tourism.xls";

proc export data=sashelp.tourism outfile=s replace  dbms=xls;

            newfile=yes; version=2003 ;run;

proc import datafile="~wi/tourisme.xls" out=sp4test dbms=xls;run;

proc import datafile="~wi/testpoursas.xls" out=sp4test3 dbms=xls;

sheet='Feuil2'n;       

run;

proc import datafile="~wi/Fichecp.xls" out=sp4test4  dbms=xls;

sheet='Feuil1'n;       

run;



Andre

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 908 views
  • 0 likes
  • 3 in conversation