SAS University Edition So I'm trying to import some data into SAS from an excel file. (You can see the data in the xls file I've attached) SAS is unfortunately not using the years like 1975,1976 etc as column headers which is what I want - it is using B C D E like excel sheets have by default. I used this code to get the data into SAS: PROC IMPORT DATAFILE='/folders/myfolders/Historic Mortality data/Historic Mortality data/deathsbysingleyearofage.xls'
DBMS=XLS
OUT=WORK.DeathsByAgeWomenUK;
GETNAMES=no;
SHEET="Table 2";
RANGE="MyRange2";
NAMEROW=4;
RUN; As previously mentioned - my data is meant to have years such as "1975" and "1976" as the column headers but it isn't, it's using "Age" yes but then jumping straight to using B,C,D etc. from excel. I was thinking of doing this: DATA DeathsByAgeWomenUKEDIT;
SET WORK.DeathsByAgeWomenUK;
RENAME B="1974" C="1975" D="1976";
RUN; But obviously for every single column, which would probably take too much time. I was thinking there's gotta be a way to do this easier - but I cannot find anything anywhere on how to do it. Any help with this would be hugely appreciated. Also feel free to ask any question if I haven't made this entirely clear 🙂
... View more