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 2009, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 4 Jun 2009 19:36:05 -0400
Reply-To:     Nathaniel.Wooding@DOM.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Nat Wooding <Nathaniel.Wooding@DOM.COM>
Subject:      Re: Separating Two Words into Two Variables
In-Reply-To:  <20090604153906.yyyx7tdhyck4skck@mail.ucla.edu>
Content-Type: text/plain; charset="US-ASCII"

Jason

For this, use the scan function.

If A = 'Apple District';

A1 = Scan( A , 1); A2 = Scan(A , 2 , ' '); run;

Since a blank is the seperator, you do not have to specify the third term in the function but you may if you wish.

Nat Wooding Environmental Specialist III Dominion, Environmental Biology 4111 Castlewood Rd Richmond, VA 23234 Phone:804-271-5313, Fax: 804-271-2977 Cel Phone: 804-205-0752

J M <jasonm@UCLA.EDU> Sent by: "SAS(r) To Discussion" SAS-L@LISTSERV.UGA.EDU <SAS-L@LISTSERV.U cc GA.EDU> Subject Separating Two Words into Two 06/04/2009 06:39 Variables PM

Please respond to jasonm@UCLA.EDU

How do I create two variables from a variable that contains observations with two words? For example, if a=Apple District how would I create a1=Apple and a2=District? or if a=Green Region how would I create a1=Green and a2=Region? Thank you.

CONFIDENTIALITY NOTICE: This electronic message contains information which may be legally confidential and or privileged and does not in any case represent a firm ENERGY COMMODITY bid or offer relating thereto which binds the sender without an additional express written confirmation to that effect. The information is intended solely for the individual or entity named above and access by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution, or use of the contents of this information is prohibited and may be unlawful. If you have received this electronic transmission in error, please reply immediately to the sender that you have received the message in error, and delete it. Thank you.


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