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 (March 2009, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 17 Mar 2009 10:11:10 -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: Extract word from a line in the raw data file
In-Reply-To:  <200903171347.n2HAmWqr026048@malibu.cc.uga.edu>
Content-Type: text/plain; charset="US-ASCII"

It looks like your dsn starts around column 28 (but I would recount this if I were you). If you always have the same width of stuff at the start, you could write

dsn = substr( line , 28 );

by the way, do your "good" lines always have a colon and the junk lines do not? If so, a simple test for good stuff would be

if index( line , ':' ) ;

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

Abc Unha <abcunha@YAHOO.CO M> To Sent by: "SAS(r) SAS-L@LISTSERV.UGA.EDU Discussion" cc <SAS-L@LISTSERV.U GA.EDU> Subject Extract word from a line in the raw data file 03/17/2009 09:47 AM

Please respond to Abc Unha <abcunha@YAHOO.CO M>

I have a raw data file like below

*****some junk data***** *********************** 20090913:10:23:36: 00000002 FROM ABC.ADDRESS_RAWDATA AS ADDRESS_RAWDATA 20090913:10:23:36: 00000002 FROM ABCDEF.NAMES_RAWDATA AS NAMES_RAWDATA 20090913:10:23:36: 00000002 IOM LOG (73,20):111 FROM DATAABC.WHATEVER_RAWDATA AS WHATEVER_RAWDATA *****some more junk data***** ***********************

In above file ABC, ABCDEF and ABCDEF are library so I can serch for tat using index function but I need to pull table name with libref. So for e.g. here is the the line I got after using index function (index(line,'FROM ABC.') >0 20090913:10:23:36: 00000002 FROM ABC.ADDRESS_RAWDATA AS ADDRESS_RAWDATA

Now I only want ABC.ADDRESS_RAWDATA from above line. Do you know any function or anyway to do this?

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