LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 4 Jun 2004 11:52:30 -0400
Reply-To:     "Droogendyk, Harry" <harry.droogendyk@RBC.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Droogendyk, Harry" <harry.droogendyk@RBC.COM>
Subject:      Re: Combining Variables
Content-Type: text/plain; charset=iso-8859-1

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.


Back to: Top of message | Previous page | Main SAS-L page