sas, WARNING: Variable Upper already exists on file

sas >> WARNING: Variable Upper already exists on file

I am intermittently getting the warning " WARNING: Variable [variable name] already exists on file" when I output a file using "outp" or "outpm" in Proc Mixed.

Even if I delete the old datasets before I re-run the program, I sometimes get it. I searched the online doc, but can't find anything about this warning. I use SAS on Unix. Does anyone know what is causing this warning? THANKS

sas >> WARNING: Variable Upper already exists on file

It's not a conflict with a pre-existing dataset of the same name. Rather,
it's the result of trying to create two variables with the same name in the
output dataset.

I can replicate the message using Base SAS v 9.0 with the following code:

data ab;
retain a 0 b 1;
run;

proc sql;
create table aa as
select a, b as a
from ab;
quit;

Look at any code in which you provide names for variables to be included in
the output dataset. Do you reuse any names, or specify a name which
conflicts with some automatically created variable?

If you can't find the source of the problem, post an example of code which
displays the message when you run it.

On Thu, 6 May 2004 09:38:23 -0400, Dennis, Helen < XXXX@XXXXX.COM >

name] already exists on file" when I output a file using "outp" or "outpm"
in Proc Mixed.
get it. I searched the online doc, but can't find anything about this
warning. I use SAS on Unix. Does anyone know what is causing this warning?
THANKS

Hi SAS9/ MDR gurus,
I get the following error when I attempt to modify a SAS dataset
registered in the SAS Metadata Repository.
===============================================================
88 data data5.test;
89 do a=1,3,2,4;
90 output;
91 end;
92 run;
NOTE: The data set DATA5.TEST has 4 observations and 1 variables.
NOTE: DATA statement used (Total process time):
93 libname data5 list;
NOTE: Libref= DATA5
Scope= DMS Process
Engine= META
Physical Name=
File Name= C:\xxx\xxx\xxx\xxx\xxx\data
94 proc sort data=data5.test;
95 by a;
96 run;
ERROR: The member name DATA5.TEST already exists in metadata.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.09 seconds
cpu time 0.01 seconds
97 libname data list;
NOTE: Libref= DATA
Scope= DMS Process
Engine= V9
Physical Name= C:\xxx\xxx\xxx\xxx\xxx\data
File Name= C:\xxx\xxx\xxx\xxx\xxx\data
98 proc sort data=data.test;
99 by a;
100 run;
NOTE: There were 4 observations read from the data set DATA.TEST.
NOTE: The data set DATA.TEST has 4 observations and 1 variables.
NOTE: PROCEDURE SORT used (Total process time):
real time 0.07 seconds
cpu time 0.03 seconds
===========================================================================
Note that DATA5 is the library registered in the MDR and DATA is a regular
SAS library which points to the same physical folder.
OPSYS: Windows XP
SAS: 9.1.3 SP3
I've spoken to SAS Tech Support who've made suggestions about using the
METAOUT= option on the meta LIBNAME statement which didn't work. And they
mentioned that in SP4 METAOUT= is being changed, not in any useful way.
So, in summary, what I expect to do is:
A. Write normal base SAS code with multiple data steps and proc steps that
create and modify the same SAS data set several times
B. Be able to access these SAS datasets using a (META) Libname that points
to the MDR which then points to the physical folder using base SAS engine.
C. Have the MDR stay in sync with the changes in each step.
This is my understanding of how the MDR works - an additional layer
between the user program and the physical folder in order to provide
security and remove the need for the user to know anything about the
physical storage of the data.
If you can help with this, I'd be very grateful.
Regards
MK

You have misunderstood how the RETAIN statement works here. It does not
change the value of any variable that is in your input data set. All the
variables in your input dataset are by definition automatically RETAINed.
When you initialize the variables in the RETAIN it also sets the variable
type. This is one of the places where you can have a problem with character
variables. The lengths in the input data set may be different from the ones
set in the RETAIN.
If you are working with a standard data structure then try to get hold of a
data set that has all the variables defined with the appropriate length,
label etc.. and then use it as:
data myfinaldata ;
if 0 then set <insert the name of the standard dataset> ;
set <your input data set> ;
run ;
This should get you what you want. If you don't have a standard data set
then define one with ATTRIB statements and use the same code as above.
Venky Chakravarthy
On Tue, 11 Apr 2006 14:23:45 -0400, Rathindronath < XXXX@XXXXX.COM >
wrote:
>Thanks a loteveryone. But i should not use C & E in the retain sattement (
>NO HARDCODING).
>
>I am supposed to have A, B, C, D, E variables in a dataset.
>My goal is to check if A, B, C, D, E all of those variable are in the
>dataset. If not then just put the missing varibles TO it but no values (
>CAUSE THESE VARIABLES DIDN'T HAVE ANY VALUES).
>
>Like I have A, B & D variables in the dataset. Now I should check if I
>have A, B, C, D & E all of them is in the datatset. If not then put the
>rest of the variables to that dataset. Like put C & E ( cause they are not
>there, though they were supposed to be there). so the dataset become have
>all the variables: A, B, C, D, E.