Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: unexpected end of file

From   Dani Tilley <>
Subject   Re: st: unexpected end of file
Date   Tue, 17 Aug 2010 08:33:28 -0700 (PDT)

Hi Bill,

Thanks for the comprehensive reply. I was able to solve the problem by adding a 
comment after -end- to make sure that my text editor did not omit any empty 
lines after -end-. 

And yes, Peter, this is just an example ado.


----- Original Message ----
From: "William Gould, StataCorp LP" <>
Sent: Tue, August 17, 2010 9:58:35 AM
Subject: Re: st: unexpected end of file

Dani Tilley <> wrote an ado-file called mean2.ado 
and it evidently works, 

>         . sysuse auto, clear
>         . mean2 price mpg
>         Mean for price: 6165.2568
>         Mean for mpg: 21.297297

Yet, Dani reports, 

> when I save the program as mean2.ado, copy it to ado/updates, and say 
> -mean2 price mpg- Stata returns:
>        unexpected end of file
>        (error occurred while loading mean2.ado)
>        r(612);

To debug this problem, I recommend Dani do the following.

    1.  Verify Dani still has the problem.  Type
                . program drop _all
                . sysuse auto, clear 
                . mean2 price mpg

    2.  Find out where mean2.ado is.  Type

                . which mean2
                  <output omitted>

        Stata will display full path and filename.
        Q1. Is this the path and filename Dani expected?

    3.  Look at the file.  Type 

                 . type <insert full path and filename here>
                   <output omitted>

        Q2. Are these the contents Dani expected?

    4.  Watch the error occur.  Type 

                 . program drop _all

                 . do <insert full path and filename here>

        The ado-file will be treated as a do-file and Dani will be able 
        to watch it load.  The location of the r(612) will be pinpointed.

    5.  Clean up after running step 4.  Type 

                 . program drop _all

    6.  Fix problem.  If the answer is not obvious, Dani should 
        include the output steps 2, 3, and 4 in any further questions.

-- Bill
*   For searches and help try:


*   For searches and help try:

© Copyright 1996–2015 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index