| Date: | Wed, 27 May 2009 07:55:58 -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: removing a string |
|
| In-Reply-To: | <200905270953.n4QMaQsa000480@mailgw.cc.uga.edu> |
| Content-Type: | text/plain; charset="US-ASCII" |
|---|
Annie
Try the following:
Data annie;
filename indd 'c:\park\annie.txt';
infile indd truncover;
informat num 8. dept $40.;
input num dept & ;
where = index( dept , '&' );
drop where;
if where then
Dept = catx( ' ' , substr( dept , 1 , where ) , substr( dept , where
+ 5 ));
run;
Nat Wooding
Environmental Specialist III
Dominion, Environmental Biology
4111 Castlewood Rd
Richmond, VA 23234
Phone:804-271-5313, Fax: 804-271-2977
Annie Lee
<hummingbird10111
@HOTMAIL.COM> To
Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU
Discussion" cc
<SAS-L@LISTSERV.U
GA.EDU> Subject
removing a string
05/27/2009 05:53
AM
Please respond to
Annie Lee
<hummingbird10111
@HOTMAIL.COM>
Hi,
I would like to extract and remove a string (&) from a variable.
I would appreciate it if anyone can offer any advice!
Data:
num Dept
1 IT HR
2 IT Education & Service
3 IT Catering
4 Media HR
5 Media Receiving & Delivery
Results:
num Dept
1 IT HR
2 IT Education & Service
3 IT Catering
4 Media HR
5 Media Receiving & Delivery
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.
|