Hi Sap,
If you dont want the Expenses NetIncome Employees vars then why bring them in in the first place? If there's a reason you could always do a drop/keep to loose them.
As for your "&" I'd suggest you have a look at the INDEX function.
This allowed you to search a variables string and...
Well..
What error are you getting?
Also ...
Aren't you missing a \
put '"c:\program files\winzip\winzip32.exe"' "&filename" '.zip ' "&filename" '.xls';
Hi,
On the SAS knowledge base there's this example on password protecting excel files via DDE:
http://support.sas.com/kb/31/328.html
And for Zipping up files again another SAS help file:
http://www2.sas.com/proceedings/sugi29/077-29.pdf
The above zip example will need to be modified if its...
If you want a SAS dataset onto a local drive there's a couple of ways to do it.
i) Create a libname where you want the dataset to go and then use a data step referencing that outputted libname.
ii) Use a Proc Append
You're getting an error as in one or more of the datasets you're setting together has different formats for the same vars.
If all 86 files are meant to be the same and are sourced the same I'd say fix the source.
It could be just 1 of the source files that you need to fix.
To find this you...
Ok, try deleting the whole "sheet" line and re trying.
As for file names you'll need:
File_20&i
And use %do i = 01 %to 20
As for the error I missed a .
So:
DATAFILE="V:\pcsas_export_files\invoices_&i..xls"
I'm on my phone now so unable to test.
So if its just the invoice one..
%macro overall;
%do i = 1 %to 7; /*where 1 is the first number and 7 is the last*/
PROC IMPORT OUT= lib.clients_invoices&i
DATAFILE="V:\pcsas_export_files\invoices_&i.xls"
DBMS=EXCEL2000 REPLACE;
SHEET="Sheet1$";
GETNAMES=YES;
RUN...
When SAS does a Proc Import it will format it to "BEST" basically. You'll need to add formats to subsequent data steps.
Onto the Macro..
Are your 20 files all in the same folder?
Im sure there are some infile options that can do this, check out:
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000146932.htm
For a dirty solution you could always do:
if testcode >1 then helper = 1;else helper = 0;
----
Next datastep
if helper = 0 then...
Hi,
Using a Proc Import would solve your problem...
SAS would automatically place an underscore for spaces...as for special chars. SAS would label them as seem in excel, but rename them...
Eg
Excel----SAS name---SAS Label
Client#--Client_----Client#
PROC IMPORT OUT= lib.clients_invoices...
What about an IF/ELSE?
Maybe something like...
new_sasdate = input(osjomtpv,yymmdd8.);
if new_sasdate - today() <= 5 then osinko ="DIVIDEND";
else
if weekday(new_sasdate) = 1 then osinko ="";
else
if weekday(new_sasdate) = 7 then osinko ="";
TEST=new_sasdate - today();
if TEST < 0 then...
A simple loop should suffice..
%macro overall;
data setted;
set
%do i = 1 %to 7; /*where 1 is the first number and 7 is the last*/
p_claim.file06_2001_&i
%end;
;
run;
%mend;
%overall;
have you tried to using the built in export feature
File>Export Data
And see if it fails again.
Also, if when you're exporting its replacing a file you want to make sure the file isn't opened by someone else or someone may be locked in it if its on a network drive
I'd love to help, but I cannot get my head around how tad would be worked out... if you can give me a written example of what you'd expect tad to be and why...
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.