When merging 2 tables on a common by-variable you run the risk of having a different length on this (or these) by variable(s). If this is the case, SAS will casually inform you with the following warning:
WARNING: Multiple lengths were specified for the BY variable mergevar by input data...
Reduce hard coding by using the VCOLUMN table in SASHELP to get a list of your variables into a macro variable array.
Very often it is useful to have a list of all the variables you have in a certain table. You don’t always want to type them out yourself (hard coding) but instead want an...
You can try this:
data basetabel_imputed (drop=varname val row n) varnames (keep= varname val row);
set basetabel (obs=50 ) end=last;
array wit{*} _numeric_;
n + 1;
do i=1 to dim(wit);
if wit(i)=. then do;
varname = 'mv'||vname(wit(i));
val = 1;
row = n;
output varnames...
Imagine you want to have a list of products bought by customers, for instance the ones who live in the US.
If your database has a somewhat reasonable structure, the transaction data and the customer’s country will be kept separately.
So there are 2 different tables in your SAS data warehouse...
How about you don't use the quotes in your macro but in the macro-call, like so:
%Import_I_E('Path=\\F\Forms\I&E forms\2011\06 June\',
Doc="888745 -O'Shane.XLS",
Dmod=18782,
Tmod=46380,
Team=Team 1)
and then leave them out in the macro itself...
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.