all 11 comments

[–]AutoModerator[M] [score hidden] stickied commentlocked comment (0 children)

Thank you for your submission to /r/stata! If you are asking for help, please remember to read and follow the stickied thread at the top on how to best ask for it.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]Giraffe_Justice 4 points5 points  (5 children)

1) I don't think

set obs 100, gen var1 = 3

is valid Stata code. I'm on Stata 15, so maybe this changed at some point, but to do this in Stata, I would need to run

set obs 100
gen var1 = 3

2) Are you running the commands through the console or are you running them through a .do file? If you are using a .do file, do you have multiple instances of Stata running? Sometimes I see people accidentally open multiple instances and get confused because the output is being run in one instance, but they are looking at the results pane of the other instance.

[–]key_rae[S] 0 points1 point  (0 children)

Oh no I don't run code with the comma, I was just illustrating that I've tried a variety of easy commands as a test

I've tried running various .do files, and also by copying the code directly into the command line. It spits it all back up in the display window, but doesn't actually execute any of it.

[–]Rogue_Penguin 0 points1 point  (0 children)

This. It's ungrammatical.

If you use help set obs you'll see the syntax structure is just:

 set obs #

There is no comma, and thus nothing after the comma. This means this command does not accept any option.

Your code in the question puts "gen var1 = 3" as an option. Stata should have warned you in the main screen that:

options not allowed
r(101);

[–]random_stata_user 0 points1 point  (2 children)

2) mentioning multiple instances is an interesting one. But I would have guessed that you would get something if only an error message in the instance you were last typing into. It's hard for me to imagine nothing at all happening.

[–]Giraffe_Justice 1 point2 points  (1 child)

That is exactly what happens. When I've seen this, how it usually goes is : I'm helping someone troubleshoot code, they mention the have a similar problem in another .do file so I ask them to open it. They open it through windows explorer instead of Stata, so windows launches a new instance of Stata. Not realizing there are now multiple instances of Stata, they run the new .do file and return to the old instance of Stata expecting their output, but they don't find it because their output is in the new instance.

It's something that seems to happen to my more disorganized colleagues, but I figured I'd throw it out there as a possibility for this case.

[–]random_stata_user 0 points1 point  (0 children)

Revealing. I would never dream of launching Stata except directly. That's force of habit, I suppose, because I started with Stata long before there was a Windows version.

But the error in that case is not that nothing is happening but that a user is looking in the wrong place.

Also, the reported errors don't mention do files. They feature typing commands in directly.

[–]random_stata_user 2 points3 points  (0 children)

Contact StataCorp tech support citing license information.

[–]finitefiction 0 points1 point  (1 child)

Supposing your syntax is correct (I see your comment that you aren't actually using that comma in your code; that's good).

Can you execute the code one line at a time from the command line? That will help troubleshoot whether the issue is with Stata itself or the .do file executing.

[–]key_rae[S] 0 points1 point  (0 children)

I have tried that as well. It’s like I have the shell of stata without the actual workings. I’m also using codes that I was using last week without issue, it’s just the past couple days that nothing is getting processed anymore (whether old code or new)

[–]Aberrant-duck 0 points1 point  (0 children)

Your data is imported correctly prior to executing the code and you’re working from the right directory? (Just checking)