Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Interrupting a command line with /// does not work as described...

    Interrupting a command line with /// does not work as described under "help comments". I use Stata 15, but the seperator "///" in a command line is not recognized as a seperator. How is that possible?
    Thanks a lot for help!
    Rene

  • #2
    Hi Rene. As the FAQ says, you should include in your post the commands that you issued to Stata along with the output, with both of those things enclosed in code delimiters. (To enclose text in code delimiters, highlight the text, then click the # button on the tool bar.)

    My guess, not having seen your code, is that you need to insert a blank space before the /// line continuation operator. See the example below. Notice that the second example (with no space after the comma) does not work. HTH.

    Code:
    . clear
    
    . sysuse auto
    (1978 Automobile Data)
    
    .
    . summarize mpg, ///
    > detail
    
                            Mileage (mpg)
    -------------------------------------------------------------
          Percentiles      Smallest
     1%           12             12
     5%           14             12
    10%           14             14       Obs                  74
    25%           18             14       Sum of Wgt.          74
    
    50%           20                      Mean            21.2973
                            Largest       Std. Dev.      5.785503
    75%           25             34
    90%           29             35       Variance       33.47205
    95%           34             35       Skewness       .9487176
    99%           41             41       Kurtosis       3.975005
    
    .
    . summarize mpg,///
    option / not allowed
    r(198);
    
    end of do-file
    
    r(198);

    --
    Bruce Weaver
    Email: [email protected]
    Version: Stata/MP 19.5 (Windows)

    Comment


    • #3
      Extending Bruce's comment, note that he is assuming that you are submitting your code in a do-file. If instead you are typing the command interactively into Stata's Command window, that syntax is not allowed.

      The output of help comments links the reader to Section 16.1.2 "Comments and blank lines in do-files" found in [U] - the Stata User's Guide PDF included with your Stata installation (clicking on the link will open Acrobat Reader at that location). There you will see

      Technical note

      The /* */, //, and /// comment indicators can be used in do-files and ado-files only; you may not use them interactively. You can, however, use the ‘*’ comment indicator interactively.

      Comment


      • #4
        I suspect either Bruce or William has nailed it. I'll also recommend to Rene that providing code and output would probably make it much easier to diagnose the problem.

        That missing blank space error is especially insidious because you often get a totally bizarre error message that makes no sense when the real problem was just that you ran two things together that should have been separated by a space.
        -------------------------------------------
        Richard Williams, Notre Dame Dept of Sociology
        StataNow Version: 19.5 MP (2 processor)

        EMAIL: [email protected]
        WWW: https://academicweb.nd.edu/~rwilliam/

        Comment


        • #5
          Thanks a lot to you all! My mistake was to oversee the limitation of saparators like ' /// ' to .do and .ado files (this is not mentioned under "help comment").

          Sorry for not having supplied my code. I will do so in the future. Her my code was:

          Code:
          twoway ///
          (line  ln_real_exch_FRA_GER month, ylabel(, labsize(small)) lpattern(solid) yaxis(1) ytitle("ln(Unemployment Rate)", size(small)) ytitle("", axis(1)) ) ///
          , title( "Unemployment Rate", size(large)) ///
          subtitle("USA", size(medium)) ///
          Saved in an do-file, the code works with the separator '///'.

          Comment

          Working...
          X