|
After ensuring that the length of one_variable is adequate for the
concatenation:
one_variable = variable_a || variable_b;
Or, for numeric data:
one_variable = put(variable_a,12.) || put(variable_b,12.); * or whatever
format is appropriate;
You may want to compress( ) to rid yourself of trailing blanks in
variable_a:
one_variable = compress(variable_a || variable_b);
Note that this construction can be done on the fly in SQL as well:
proc sql;
select compress(variable_a || variable_b) as one_variable
from ...
-----Original Message-----
From: Nicole Bibb [mailto:nicole.d.bibb@WELLSFARGO.COM]
Sent: Friday, June 04, 2004 11:40 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Combining Variables
How do I combine two variables into one variable that reside in the same
dataset?
------------------------------------------------------------This e-mail may be privileged and/or confidential, and the sender does not waive any related rights and obligations. Any distribution, use or copying of this e-mail or the information it contains by other than an intended recipient is unauthorized. If you received this e-mail in error, please advise me (by return e-mail or otherwise) immediately.
Ce courrier électronique est confidentiel et protégé. L'expéditeur ne renonce pas aux droits et obligations qui s'y rapportent. Toute diffusion, utilisation ou copie de ce message ou des renseignements qu'il contient par une personne autre que le (les) destinataire(s) désigné(s) est interdite. Si vous recevez ce courrier électronique par erreur, veuillez m'en aviser immédiatement, par retour de courrier électronique ou par un autre moyen.
============================================================
|