Is there a way to use a file by adressing the using variables not by their names (or wildcarded names), but by their position in the file - like var number 1 through var number 100, for instance?
The background of my question: I have written syntax to process a host of Stata files from a directory. Some of them have a lot of variables which increases the runtime exceedingly. I want to open those files in a loop by using the first x variables, then the next x variables and so on until the end.
I know I could open the file and extract the list of all variables and use that list. But I ask myself if there is a way to adress parts of the using variables in the use <datafile>, using... command if you have no knowledge at all on the variable names of that file. If that was possible, the syntax I write could be used by any user of our panel data (SOEP), even if he/she uses a Stata version that can not open files with more than 2.047. variables.
The background of my question: I have written syntax to process a host of Stata files from a directory. Some of them have a lot of variables which increases the runtime exceedingly. I want to open those files in a loop by using the first x variables, then the next x variables and so on until the end.
I know I could open the file and extract the list of all variables and use that list. But I ask myself if there is a way to adress parts of the using variables in the use <datafile>, using... command if you have no knowledge at all on the variable names of that file. If that was possible, the syntax I write could be used by any user of our panel data (SOEP), even if he/she uses a Stata version that can not open files with more than 2.047. variables.
Comment