Announcement

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

  • set more off in do file

    Using any recent version of Stata for Windows, I find that "set more off" has no effect when I run it from a do file. It only does its thing if I type it on the command line.

    Is this a known issue? Any workaround?

  • #2
    set more on|off only works locally, i.e. within a session or do-file job. But you may let it work permanently:
    Code:
    set more off , permanently

    Comment


    • #3
      set more off definitely works when run from a do-file. Please show example code where the command has no effect.

      Comment


      • #4
        Asking for an example was a good idea. I wrote a do file containing the following code.
        /* 1 */ set more off
        /* 2 */ sysuse auto
        /* 3 */ list
        /* 4 */ set more on
        Now if I run the whole do file at once, it works great. Stata lists all 74 lines of the autos dataset.

        But I get different behavior if I first run line /* 1 */ and then run lines /* 2 */ to /* 4 */.
        If I do that, Stata list the first 35 lines of the autos dataset, and then says --more--. This happens even if I add the permanently option to line 1.

        Comment


        • #5
          For what it's worth, I cannot produce the failure of -set more off, perm" that you describe under v.14.0, revision 03 Aug 2015.

          Comment


          • #6
            Under Stata v. 13.1 for Macintosh I can confirm that the effects of set more off are terminated when the do-file within which it is run ends, and I can confirm that remains the case when the permanent option is included, again when run from within a do-file.

            Nowhere in my documentation do I find that setting of system parameters is local to the do-file within which it is executed. I'm befuddled, perhaps one of the more experienced participants can point me in the right direction.

            Code:
            . do "/var/folders/xr/lm5ccr996k7dspxs35yqzyt80000gp/T//SD30859.000000"
            
            . set more off
            
            . display c(more)
            off
            
            .
            end of do-file
            
            . display c(more)
            on
            
            . do "/var/folders/xr/lm5ccr996k7dspxs35yqzyt80000gp/T//SD30859.000000"
            
            . set more off, perm
            (set more preference recorded)
            
            . display c(more)
            off
            
            .
            end of do-file
            
            . display c(more)
            on
            
            . about
            
            Stata/SE 13.1 for Mac (64-bit Intel)
            Revision 03 Jun 2015

            Comment


            • #7
              This is discussed in Stata manual [U]USER’S GUIDE, section 7.2, "set more off".

              Programmers: Do-file writers sometimes include set more off in their do-files because they do
              not care to interactively watch the output. They want Stata to proceed at full speed because they plan
              on making a log of the output that they will review later. Do-filers need not bother to set more on
              at the conclusion of their do-file. Stata automatically restores the previous set more when the do-file
              (or program) concludes.

              Comment


              • #8
                Indeed it is. It's a shame then that help more refers the reader to [R] more and [P] more for further information, and neither of those sources includes the warning, other than to refer the reader to, among a number of other sources, [U] 7 --more conditions--. I would expect reference information directed at programmers to appear in [P] Stata Programming Reference Manual.

                I will also add when set more, permanent is run from within a do-file, "permanent" does take effect, although not at exiting from the do-file, as I showed above, but rather when Stata is exited and relaunched.

                Comment

                Working...
                X