Hi
I need to import file from Excel to SAS and to rename all fields. Actually I already imported file from Access ones.
I assume it should be like the following....I assume I just need to put FILE instead TABLE (in Access). Also I assume I need
to specify a sheet....
I am not sure how to rename columns names in Excel in order tem to be consistent in SAS...I tried to use help on-line . Below
is what I assume...
Also...some of my member id in excel do not have leading zeroes which I need if member id is less then 9 digits (for ex I
need 012345678 instead 12345678). I assume I need to use FORMAT function? In what way?
Thank you very much in advance
Rina
*******************************************************************************
libname mylib 'c:\myDir\rina\myFolder\SAS Datasets';
*** InTbl: Name of Sheet in Excel worksheet to be imported;
*** SASTbl: Name of SAS output data set;
*** InFl: Complete path and name (with .xls extension) of Excel file to be imported;
proc import file='sheet1'
out=myOutput
dbms=excel;
workgpdb='myGrp';
RENAME MEMBER_ID = MEMBER ID
NUMBERS_OF_VISITS=# OF VISITS
MEMBER_REFFERED=HAS MEMBER BEEN REFFERED;
file='c:\myDir\rina\myFolder\myFile 'v2000.xls';
userid='rina';
password=' ';
workgpdb='myGrp';
run;
I need to import file from Excel to SAS and to rename all fields. Actually I already imported file from Access ones.
I assume it should be like the following....I assume I just need to put FILE instead TABLE (in Access). Also I assume I need
to specify a sheet....
I am not sure how to rename columns names in Excel in order tem to be consistent in SAS...I tried to use help on-line . Below
is what I assume...
Also...some of my member id in excel do not have leading zeroes which I need if member id is less then 9 digits (for ex I
need 012345678 instead 12345678). I assume I need to use FORMAT function? In what way?
Thank you very much in advance
Rina
*******************************************************************************
libname mylib 'c:\myDir\rina\myFolder\SAS Datasets';
*** InTbl: Name of Sheet in Excel worksheet to be imported;
*** SASTbl: Name of SAS output data set;
*** InFl: Complete path and name (with .xls extension) of Excel file to be imported;
proc import file='sheet1'
out=myOutput
dbms=excel;
workgpdb='myGrp';
RENAME MEMBER_ID = MEMBER ID
NUMBERS_OF_VISITS=# OF VISITS
MEMBER_REFFERED=HAS MEMBER BEEN REFFERED;
file='c:\myDir\rina\myFolder\myFile 'v2000.xls';
userid='rina';
password=' ';
workgpdb='myGrp';
run;