To exit Stata, pull down the ``File'' menu and select ``Exit'' or ``Quit''. Sometimes when you do this and the data in memory has not yet been saved Stata will not let you exit. In this case, a dialog box will appear giving you the option to ``Exit Anyway'' or ``Don't Exit.''
To exit Stata from the command line type exit. Sometimes Stata won't let you exit and gives you a message ``no;data in memory would be lost''. This message warns you that the data currently in memory has not been saved. To exit you have two choices:
exit, clear
save yourdataexit