Announcement

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

  • Robert Picard
    replied
    Both isco and isko are available from SSC. From the help file for iscoisei:
    The isco package consists of a series of programs to recode ISCO-68
    and from the help file for iskoisei:
    The isko package consists of a series of programs to recode ISCO-88
    So if the OP wants to convert ISCO-88 codes, the isko package is the one to use.

    I can replicate the issue in #1:
    Code:
    . cap ado uninstall isko
    
    . 
    . ssc install isko
    checking isko consistency and verifying not already installed...
    installing into /Users/robert/Library/Application Support/Stata/ado/plus/...
    installation complete.
    
    . 
    . * Example generated by -dataex-. To install: ssc install dataex
    . clear
    
    . input int focc
    
             focc
      1. 1110
      2. 1141
      3. end
    
    . 
    . iskoisei fisei, isko(focc)
    command B is unrecognized
    (error occurred while loading iskoisei.ado)
    r(199);
    
    end of do-file
    The last few lines of "iskoisei.ado" are (and include an end of line character on the last line)
    Code:
        quietly replace `varlist'=22 if (`isko' == 9331)
        quietly replace `varlist'=22 if (`isko' == 9332)
        quietly replace `varlist'=30 if (`isko' == 9333)
    end
    B
    If you copy "iskoisei.ado" to the current directory and remove the offending "B" at the end of the ado file, you do not get the error anymore since the offending command has been removed.

    If I leave the "B" but remove the final end of line character, I get no error. So it looks like this may indeed be related to the issue of code on the last line without an end of line character (as pointed out by Sergiy) and the outcome depends on how the file was downloaded. No matter what, extra text at the end of a do-file will produce an error if it is not valid Stata code. For example, save the following in a file called "whatsup.ado" in the current directory:
    Code:
    program whatsup
        dis "hello"
    end
    noi dis "this is valid code"
    saywhat
    If you try to run the program, you get:
    Code:
    . whatsup
    this is valid code
    command saywhat is unrecognized
    (error occurred while loading whatsup.ado)
    r(199);
    So the author should be contacted so that he can remove the offending "B".

    Leave a comment:


  • William Lisowski
    replied
    After some detective work, I see that
    Code:
    net describe isko, from(http://fmwww.bc.edu/RePEc/bocode/i)
    net describe isco, from(http://fmwww.bc.edu/RePEc/bocode/i)
    seem to describe the identical package, with isko dated 20041020 and isco dated earlier at 20020528. However after installing both packages using ssc install I see that
    Code:
    viewsource iskoisei.ado
    viewsource iscoisei.ado
    tells me that iskoisei is dated 15jun2001 and iscoisei later at 18jun2001. For some other components of the isko/isco packages, the isko version is later than the isco version, as would be expected from the package release dates.

    My recommendation would be to install isco and use iscoisei rather than iskoisei.

    Leave a comment:


  • Sergiy Radyakin
    replied
    The problem is probably related to issue 1428168. There is no line break at the end of the ado file, so the letter B that is there is not visible to Stata, when it loads the original ado file. Here is an example:

    Code:
    . clear all
    
    . set obs 1
    number of observations (_N) was 0, now 1
    
    . gen i=8400
    
    . iskoisei y , isko(i)
    
    . l
    
         +-----------+
         |    i    y |
         |-----------|
      1. | 8400   24 |
         +-----------+
    I believe that Yapeng Wang has probably copied the content of the ado file into his do file, in which case the B will be a command since it will be followed by his own commands. The error quoted by him refers to a brace { which is nowhere to find in the original file. So it must be something else. Running with trace on should expose the erroneous code.


    Daniel, one ado file can define multiple programs. Look at ados for graphing commands for examples. Also ados may include mata code that needs to be compiled on the fly when the command is to be prepared.

    Leave a comment:


  • Jorrit Gosens
    replied
    The 'B' error is only an issue with th ado defining the program, but as Daniel says, it's after the program definition ends. So this doenst matter. The program was defined okay even with the 'B' error. The problem lies elsewhere.

    Leave a comment:


  • daniel klein
    replied
    B appears after the end statement, so I am surprised that Stata tries to execute it ...

    Edit: well, I should not be surprised since end is not exit ..., sorry.

    Best
    Daniel
    Last edited by daniel klein; 14 Feb 2018, 07:44.

    Leave a comment:


  • Sergiy Radyakin
    replied
    Inspecting the file at the URL provided by Jorrit Gosens shows that it has the command B at the end of the file. This is likely a typo or a data transfer issue, which prevents the program from being executed correctly.

    You can contact the author or the SSC archive coordinator to have it fixed by removing that command. As a workaround you can also define your own B command
    Code:
    program define B
      // do nothing
    end
    to prevent the error from showing up with the current version. Place it in B.ado somewhere along the ado search path.

    Best, Sergiy Radyakin

    Leave a comment:


  • Jorrit Gosens
    replied
    I have the ado from here: http://fmwww.bc.edu/repec/bocode/i/iskoisei.ado
    Defining the program does also give the 'command B is unrecognized' error, but the program runs with or without the unnecesary B in the ado that defines the program.
    Are you using the line 'iskoisei fisei, isko(focc)' as part of a longer ado? Tell us about that if so.

    Leave a comment:


  • Sergiy Radyakin
    replied
    Yapeng Wang,

    when I ask Stata what is iskoisei it says it doesn't know:

    Code:
    . which iskoisei
    command iskoisei not found as either built-in or ado-file
    r(111);
    Hence see #12.1 here.

    Best, Sergiy Radyakin

    Leave a comment:

Working...
X