The transpose is the first idea. Perhaps more easy to do some datasetcoding.
The thoughts:
- Define two array-s for all the company 1/ date vars 2/ tobinsq. Pehaps the naming is helping.
SAS(R) 9.4 Statements: Reference (array)
- the in a do loop for all variables write to a SAS new dataset: company-id , date(i),tobinq(i)
- let te datastep proceed for all records.
The result will be a dataset with the columns you need, just the order is different.
Ordering the data can be done by creating indexes. Base SAS(R) 9.4 Procedures Guide
Or by sorting. Proc sort (company/date)
As the dataset is that small it could easily be fit in memory or being buffered. Unless there are many timemoments (10 minute snap-shots for over many years.)
---->-- ja karman --<-----