I have to create the following data in Stata several times (say 50,000) -- one below the other. There need to be two variables: (1) a counter going from 1 to 500; and (2) a string variable that is A for the first 25 observations and then B for observations 26 to 500. Then this process needs to be repeated 50,000 times so that there are a total of 50,000*500 rows.
So far the way I have done this is by creating a CSV file with the 500 rows and 2 variables and then reading and appending it. It is a really slow and inefficient way of doing this. How can I do this within Stata?