How do I write this Stata 10 dictionary?

A H

New member
I am using Stata 10 and my data is in Ascii format. However, my data has 4 record types represented by the first 2 digits in the data. Each record does not necessarily take the same amount of rows. What I mean is that the first record might have say 3 rows for the record type 01 and 4 rows for the record type 02, etc.. and the second record might have say only 2 rows for the record type 01 and 6 rows for record type 02.
I have come across a dictionary like the one shown below but I don't think it will work for me because the example below assumes that each record is found on a single row and that each record takes only 3 rows; am I right?

dictionary using tree.dat {

_lines(3)

_line(1)

_column(1) idnum %4f

_column(5) treetype %2f

_line(2)

_column(5) soilphn %3.2f "Soil PH - North Side"

_column(8) soilphe %3.2f "Soil PH - East Side"

_column(11) soilphs %3.2f "Soil PH - South Side"

_column(14) soilphw %3.2f "Soil PH - West Side"

So, is there a way to write a dictionary that will represent my data?

Thanks for your help!

regards,
Ali
 
Back
Top