Date: Tue, 10 Oct 2000 13:11:28 -0400
Reply-To: Jim <jlinck@UGA.EDU.NOSPAM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jim <jlinck@UGA.EDU.NOSPAM>
Organization: University of Georgia
Subject: 'Parsing' a complicated text file into SAS variables/fields
Content-Type: multipart/mixed;
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). I have =
several=20
large text files from which I want to 'parse' the data into usable SAS=20
variables. 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). 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). I have attached a text file with a couple =
sample=20
records. What I want to do is to be able to extract the data=20
into different variables, keeping them associated with the =
appropriate CO=20
ID, etc. Can anybody offer advice and/or point me to some =
documentation=20
that would help?</DIV>
<DIV><FONT face=3DArial size=3D2></FONT> </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--