Hello, I am having trouble with my Stata program and I do not know what I did wrong...
The source code is below:
As you can see here, I am simply trying to parse in the correct options. However, after I loaded the auto.dta data, I typed
in the Stata console and got back an error message saying "option routine incorrectly specified". What seems to be the issue here? Any help is appreciated
The source code is below:
Code:
program define myProg, eclass version 14.0 syntax varlist(min=2) [if] [in], [,routine(str)] if (`routine' == "FirstRoutine") { di "call the first routine" } else if (`routine' == "SecondRoutine") { di "call the second routine" } else { di "no such routine available" } end
Code:
myProg make mpg, routine = "FirstRoutine"

Comment