|
Data step approach:
data your_new_table;
set your_old_table;
all_ones=1;
run;
SQL approach:
proc sql;
/*Add the new variable, all_ones, to your table*/
alter table your_table
add all_ones num;
/*Update the all_ones variable*/
update your_table
set all_ones=1;
quit;
-----Original Message-----
From: ashfaaq [mailto:ashfaaq@YAHOO.COM]
Sent: Monday, August 19, 2002 11:50 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Adding a column to a SAS dataset:Please help
I have a SAS dataset where I want to add a column which has all 1's.
The dataset currently has only 1 variable. I want the current variable
and another variable with all 1's.
**************************************************************************
The information transmitted herewith is sensitive information intended only
for use by the individual or entity to which it is addressed. If the reader
of this message is not the intended recipient, you are hereby notified that
any review, retransmission, dissemination, distribution, copying or other
use of, or taking of any action in reliance upon this information is
strictly prohibited. If you have received this communication in error,
please contact the sender and delete the material from your computer.
|