the data are saved in .csv files. "X's" are company names, "Y's" are dates, and "Z's" are the value of a variable for company X on date Y. I have quite a number of these files, each recording one specific variable, and each containing a large number of entries.
the first raw is missing one (the first) observation.
The reason I gave general specs in the first post is EXACTLY that I want to learn. I think it is very common to want to undertake a task as I described in the first thread and I am sure I will need to do it over and over again in the future. That is why I didn't give all the specs in the first place because that way I would be asking for a free code that won't work on future needs.
This should get you started.
Please read the doc to understand what it does.
retain COL1-COL3 ; * remember column names;
if _N_=1 then
input (COL1-COL3) ($); * read column names;
input (ROW VAL1-VAL3) ($); * read row name and values;
put ROW COL1 VAL1; * print out in desired format;
put ROW COL2 VAL2;
put ROW COL3 VAL3;
y1 y2 y3
x1 z11 z12 z13
x2 z21 z22 z23