Newsgroups: bit.listserv.sas-l
Date:         Wed, 6 Jan 1993 08:20:45 EST
Reply-To:     Howard Schreier <HIS@NIHCU.BITNET>
From:         Howard Schreier <HIS@NIHCU.BITNET>
Subject: Re: Reading Tricky Flat File

CONTENT:  Response/Comment
SUMMARY:  PROC TRANSPOSE operates on embedded variable names

> From:         David Nasser <NASSER@UMSLVMA.BITNET>
>
> The file in question is:
>    "Thrift Financial Report Quarterly, June 1992"
> supplied on tape from:
>    US Office of Thrift Supervision, Wash., DC
>    National Technical Info Service
>    US Dept. of Commerce

The NTIS,  part  of  the  Commerce  Department,  acts  as  a
clearinghouse or distribution agency for a great many files,
reports,  etc.   produced  by  and  for   numerous   Federal
agencies.    Responsibility   for   accuracy   of   content,
appropriateness  of  file   structure,   and   adequacy   of
documentation   rests   primarily   with   the   originating
organization (in this case, OTS).

> The doc. for this file is very, *very* sparse: there is no record
> layout as such (that we could find).  The data in this file represents
> financial info (i.e. assets, net income, etc.) on Savings and Loan
> Associations (SNLs) reported to one or more federal agencies.
>
> The record length is 128 bytes. All data is character. There are >=180
> records per SNL. The first 79 b.  of selected records for the first
> SNL follow:
>
>G0B192060034904SALEM CO-OP BK                       3 SOUTH BROADWAY
>G0C1920600349030790000ROCKINGHAM                  07416033015
>G0D192060034933010054110803N NNNNNPAAAAAAAAA     00  PPPPPPPPPPPPPXPPPNPP920731
>G0I1920600349SC10   +0000073064SC110  +0000000781SC120  +0000006202SC132  +0000
>G0I1920600349SC150  +0000000000SC162  +0000027884SC166  +0000000000SC170  +0000
>G0I1920600349SC190  +0000000466SC198  +0000000000SC20   +0000000000SC210  +0000
>G0I1920600349SC220  +0000000000SC223  +0000000000SC226  +0000000000SC23   +0000
>G0I1920600349SC24   +0000001251SC240  +0000000600SC250  +0000062805SC253  +0000
>    (172 similar "G0I" records omitted here)                              +0000
>20S1920600349CSS020348053S.C.B., INC.                         3 SOUTH BROADWAY
>20S2920600349CSS020348053SALEM                       NH000003079
>20S3920600349CSS020348053020187470SALEM CO-OPERATIVE BANK              10001A24
>20S4920600349CSS020348053120+0000000102130+0000000000140+0000000102150+00000000
>
> The first 3 recs (starting with "GOB", "G0C", "G0D" resp.) contain
> data for identifiers (i.e. name, address, etc.) and are not a problem.
> The following 177 "G0I" recs have:
>    ID info in the first 13 bytes
>    Six repetitions of:
>      A  7 b. field with a variable name
>      A  1 b. field with a sign associated with:
>      A 10 b. field with a data value
>    7 bytes of apparent garbage at the end of the record
>
> They Have Embedded The Variable NAMES In (nearly) Every Record (some-
> thing I have never _ever_ seen before)!

You can always jump  over  the  name  fields  by  using  "+"
pointer controls.

> For instance, var name SC10 (Cash less valuation allowance) can be
> read from bytes 14-20 of the first G0I rec. Similarly, the positive
> sign and the actual data value (+0000073064) can be read from bytes
> 21-31. SC10=73064. Piece of cake, eh? eh? There are 6(177)=1062 of
> these beauties.

Do you want all 1062?  Perhaps so, at  least  initially.   I
think PROC TRANSPOSE is the answer, since the embedded names
seem to be SAS-legal.

> [lines deleted]
> Does it make sense to try to read / support this data with SAS,
> given that we dont necessarily have 40 daze/40 nites to hand-code
> everything (which  will probably change with the next qrtrly file)?

I don't know of anything I'd rather use than  SAS  for  this
kind  of  problem.   As long as the definitions (SC10 = Cash
less valuation allowance, etc.), which  you  might  want  to
turn  into SAS variable labels, do not change, you should be
in good shape for the next quarter.

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
\   Howard Schreier, U.S. Dept. of Commerce, Washington    /
/                     MVS 5.18 & 6.07                      \
\   Voice: (202) 377-4180        BITNET: HIS@NIHCU         /
/   Fax:   (202) 377-4614      INTERNET: HIS@CU.NIH.GOV    \
\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU