[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: st: Build groups with the same first two numbers of SIC

From   "Nick Cox" <>
To   <>
Subject   RE: st: Build groups with the same first two numbers of SIC
Date   Fri, 20 Mar 2009 11:22:56 -0000

There's some minor confusion here. I didn't recommend fixing your loop with -capture-, as there is no need to write a loop in the first place. 

More specifically, it's not a case of anybody's preference for return codes. The return codes to work with are those that a command might return. In many cases, the return code is 0 if something works and some non-zero code if it doesn't, and the programmer can work on that basis. 


Hua Pan

Thank you very much for your help. 

Michael, your command is great, very effective. That’s exactly what I want and failed to find. Thank you indeed.

Martin and Nick, Thank you for your suggestions. After I added “capture” before “by”, the loop continued to work, and I also got the daily mean return for all firms with this complicate method. After I typed, 
-di in red _rc-
the return code was 198. Does that mean that this code is wrong? Error (198)
When I put “capture” before “by” and “save”, the loop also continued to work and I got what I want, but this time the return code was zero. 
“Capture” is really useful, that can help me a lot later, so I want to know why there are different return codes and which one should I prefer? Thanks a lot in advance.

*   For searches and help try:

© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index