Hi All,
I am trying to get the data from an excel sheet into the sas dataset. I need the data in excel sheet starting from row 6 and row 5 should be a column names. When I tried to get this with below code its giving me an error( Statement is not valid or it is used out of proper order) for the last 4 statements(mixed, namerow, startrow, endrow). Can anyone please suggest me any other alternate way on this.
proc import datafile = "C:\CR-6365.xlsx"
DBMS = xlsx
OUT = a1
REPLACE;;
sheet = "PQCs For CRAs";
GETNAMES =Yes;
Mixed=YES;
namerow=5;
startrow=6;
endrow=16;
quit;
Thanks,
Kumar.
Maxim 1: Read the Documentation.
In this case, the specific page for Microsoft Workbook Files
There are no NAMEROW, STARTROW or ENDROW statements for DBMS=XLSX (only for DBMS=XLS).
Instead, use a RANGE= statement to direct SAS to the correct part of the spreadsheet. The specific part for the RANGE statement is here.
Maxim 1: Read the Documentation.
In this case, the specific page for Microsoft Workbook Files
There are no NAMEROW, STARTROW or ENDROW statements for DBMS=XLSX (only for DBMS=XLS).
Instead, use a RANGE= statement to direct SAS to the correct part of the spreadsheet. The specific part for the RANGE statement is here.
Sounds like you have the same issue as this other question.
Just tell it where to start.
proc import
datafile = "C:\CR-6365.xlsx"
DBMS = xlsx
OUT = a1 REPLACE
;
range = "PQCs For CRAs$A5:";
run;
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: