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 (October 2000, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 10 Oct 2000 18:17:42 GMT
Reply-To:     charles_s_patridge@MY-DEJA.COM
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         charles_s_patridge@MY-DEJA.COM
Organization: Deja.com - Before you buy.
Subject:      Re: 'Parsing' a complicated text file into SAS variables/fields

Dear Jim,

It is difficult to see the sample data as you posted it here on SAS-L.

However, I suggest you look at tip00030 under Tips and Techniques on my web site "www.sasconsig.com" as part of the beginning of what you might need.

In addition, the use of the RETAIN statement will be of help to you as well based upon what I saw in your request.

At this point, I can only suggest you try your hand at a bit of SAS coding with the suggestions above to get started. Then, we might be able to help you along the way as you develop more working code.

HTH, Charles Patridge Email: Charles_S_Patridge@prodigy.net

PS, It is hard to respond directly when one posts their email address which will not allow responses (such as NOSPAM). Might I suggest posting your email address within the body of your request so people can contact you with suggestions.

In article <8rvikj$lig$1@cronkite.cc.uga.edu>, "Jim" <jlinck@uga.edu.nospam> wrote: > This is a multi-part message in MIME format. > > ------=_NextPart_000_000B_01C032BB.9972E1D0 > Content-Type: multipart/alternative; > boundary="----=_NextPart_001_000C_01C032BB.9972E1D0" > > ------=_NextPart_001_000C_01C032BB.9972E1D0 > Content-Type: text/plain; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > Win 2000. SAS v. 8 (including SAS v.8 online doc). I have several large = > text files from which I want to 'parse' the data into usable SAS = > variables. The text files are not friendly (at least from my = > perspective) in that each record contains multiple lines (some have a = > couple, some have over 100). The data I want is 'contained' within = > lines that contain keywords I can look for, but I really don't have any = > idea of how to extract out the data I want (using SAS code). I have = > attached a text file with a couple sample records. What I want to do is = > to be able to extract the data into different variables, keeping them = > associated with the appropriate CO ID, etc. Can anybody offer advice = > and/or point me to some documentation that would help? > > ------=_NextPart_001_000C_01C032BB.9972E1D0 > Content-Type: text/html; > charset="iso-8859-1" > Content-Transfer-Encoding: quoted-printable > > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> > <HTML><HEAD> > <META http-equiv=3DContent-Type content=3D"text/html; = > charset=3Diso-8859-1"> > <META content=3D"MSHTML 5.50.4207.2601" name=3DGENERATOR> > <STYLE></STYLE> > </HEAD> > <BODY> > <DIV>Win 2000. SAS v. 8 (including SAS v.8 online doc).&nbsp; I have = > several=20 > large text files from which I want to 'parse' the data into usable SAS=20 > variables.&nbsp; The text files are not friendly (at least from my = > perspective)=20 > in that each record contains multiple lines (some have a couple, some = > have over=20 > 100).&nbsp; The data I want is 'contained' within lines that contain = > keywords I=20 > can look for, but I really don't have any idea of how to extract out the = > data I=20 > want (using SAS code).&nbsp; I have attached a text file with a couple = > sample=20 > records.&nbsp; What I want to do is to be able to extract the data=20 > into&nbsp;different variables, keeping them associated with the = > appropriate CO=20 > ID, etc.&nbsp; Can anybody offer advice and/or point me to some = > documentation=20 > that would help?</DIV> > <DIV><FONT face=3DArial size=3D2></FONT>&nbsp;</DIV></BODY></HTML> > > ------=_NextPart_001_000C_01C032BB.9972E1D0-- > > ------=_NextPart_000_000B_01C032BB.9972E1D0 > Content-Type: application/octet-stream; > name="Test.asc" > Content-Transfer-Encoding: quoted-printable > Content-Disposition: attachment; > filename="Test.asc" > > 6 of 7,626 User Defined Format > CO ID: A015000000 > CO ID2: 1484111 > DATE1:12/31/90 > DATE2: 03/31/91 > > INSTITUTIONAL HOLDINGS (Type 3)=20 > LATEST QTR SHARES FILING = > > INSTITUTIONAL HOLDER RANK CHC IN SHS HELD DATE=20 > FIRST CHICAGO CORP 1 0 1,225,554 = > 03/31/91 > UNITED STATES TRUST/N Y 2 3,750 434,557 = > 12/31/90 > DIMENSIONAL FUND ADVS. 3 900 430,216 = > 03/31/91 > FIRST OF AMERICA TRUST 21 0 1,162 = > 03/31/91 > WILSHIRE ASSOC INC 22 -3,400 400 = > 03/31/91 > TOTAL OF 22 OWNERS -2,030 3,467,169 > MARKET VALUE($MILLIONS) 41 = > 03/31/91 > > OWNERSHIP BY 5% OWNERS (Type 5)=20 > NAME OF OWNER LOCATION SHARES HELD DATE = > FORM=20 > DIMENSIONAL FUND ADVISORS USA 429,316 12/31/90 = > 13G > U S TR CORP ET AL USA 447,517 12/31/90 = > 13G > TOTAL OF 4 OWNERS 2,480,024 > > OWNERSHIP BY INSIDERS (Type 6)=20 > RELATION LATEST SHARES = > FILING=20 > NAME OF INSIDER SHIP RANK TRADE HELD = > DATE=20 > SIMPSON MICHAEL CB 1 0 72,150 = > 04/90 > GRAINGER DAVID W D 2 0 56,250 = > 05/89 > HAMADA ROBERT S D 16 0 1,265 = > 05/89 > KELLER JOHN P D 17 0 1,013 = > 05/89 > TOTAL OF 17 OWNERS -22,500 312,192 > > 7 of 7,626 User Defined Format > CO ID: A015020000 > CO ID2: 00167P1 > DATE1:06/30/90 > DATE2: 12/31/90 > > 8 of 7,626 User Defined Format > CO ID: A017000000 > CO ID2: 8318651 > DATE1:12/31/90 > DATE2: 03/31/91 > > INSTITUTIONAL HOLDINGS (Type 3)=20 > LATEST QTR SHARES FILING = > > INSTITUTIONAL HOLDER RANK CHC IN SHS HELD DATE=20 > HEINE SECURITIES CORP 1 -10,000 206,900 = > 03/31/91 > SHUFRO ROSE & EHRMAN 2 -10,350 186,709 = > 03/31/91 > MITCHELL HUTCHINS INST. 3 0 111,900 = > 03/31/91 > ALLIANCE CAPITAL MGMT 19 0 2,400 = > 03/31/91 > EQUITABLE LIFE ASSUR/US 20 -135 1,365 = > 03/31/91 > TOTAL OF 20 OWNERS -31,385 941,365 > MARKET VALUE($MILLIONS) 18 = > 03/31/91 > > OWNERSHIP BY 5% OWNERS (Type 5)=20 > NAME OF OWNER LOCATION SHARES HELD DATE = > FORM=20 > SMITH INVESTMENT CO ET AL USA 2,687,534 12/31/90 = > 13G > TOTAL OF 1 OWNERS 2,687,534 > > OWNERSHIP BY INSIDERS (Type 6)=20 > RELATION LATEST SHARES = > FILING=20 > NAME OF INSIDER SHIP RANK TRADE HELD = > DATE=20 > SMITH INVESTMENT CO B 1 1,250 2,589,084 = > 01/91 > DUNAWAY DONALD L VP 2 0 4,970 = > 10/90 > SMAGLICK PAUL W VP 10 0 2,600 = > 12/89 > PYTTE AGNAR D 11 0 1,000 = > 02/91 > TOTAL OF 11 OWNERS 1,250 2,621,536 > > ------=_NextPart_000_000B_01C032BB.9972E1D0-- > >

-- Charles Patridge - PDPC, Ltd. 172 Monce Road - Burlington, CT 06013 USA Phone: 860-673-9278 or 860-675-9026 Email: Charles_S_Patridge@prodigy.net - Web: www.sasconsig.com

Sent via Deja.com http://www.deja.com/ Before you buy.


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