in my experience you can't rename the columns when importing from excel. that would be easy enough to do in a subsequent data, step, however, which is what i usually do. btw, the names you want are illegal since they have embedded spaces. you can use the label command, however, to change how...
the libname error you have is not a problem with the export function. it means that you have defined to SAS where it can find the file final. presumably this is in a directory somewhere on your hard disk (if you're using PC SAS). you need a statement like this...
libname proto "directory...
whoops! i forgot a critical line in the above.
%macro export(dsn,tab);
PROC EXPORT DATA= &dsn
OUTFILE= "C:\Path\filename.xls"
DBMS=EXCEL2000 REPLACE;
sheet="&tab";
RUN;
%mend;
i hope _this_ helps.
** mp **
assuming you have version 9
%macro export(dsn,tab);
PROC EXPORT DATA= &dsn
OUTFILE= "C:\Path\filename.xls"
DBMS=EXCEL2000 REPLACE;
RUN;
%mend;
then to execute
%export(WORKUNIX.MonthlySum,MoSum_Tab);
i hope this helps.
** mp **
in your example compress will create the text string "YearE/monthasked". Assuming that "YearE" and "monthasked" are numeric it convert them and suppress any space characters that might be included in the conversion. Without the compress function you might get something like " YearE"/"...
rather than look for the last total in column C (and off the top of my head i'm not sure how to do that, either) why not compute it separately?
if i understand the question correctly you could compute the final total by taking the initial balance and add all the deposits and subtract all...
the request as written together with the sample data do not make sense. what does "average number of products sold by person" mean? with the sample data provided one can derive the count but an average is meaningless since there is no denominator to average with.
otoh, if you had variables...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.