Announcement

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

  • My do file is showing a "null" error and all the codes are not showing

    Hello Stata experts!
    I have saved my work in a do file. But today, when I try to open my do file, it shows “null” all over the document. I need your guidance to solve this issue. I am attaching the image as well.
    Attached Files

  • #2
    What was the command you used to "save" your work? The command save saves the dataset in a file with .dta file format, regardless of any file extension you supply. If that is what happened, use not do is needed to open the file. If that doesn't work, it is hard to know what you did.

    Comment


    • #3
      Originally posted by Nick Cox View Post
      What was the command you used to "save" your work? The command save saves the dataset in a file with .dta file format, regardless of any file extension you supply. If that is what happened, use not do is needed to open the file. If that doesn't work, it is hard to know what you did.
      Sir, it's not a data file. Its a "Do" file containing my codes to analyse my data

      Comment


      • #4
        Originally posted by Nick Cox View Post
        What was the command you used to "save" your work? The command save saves the dataset in a file with .dta file format, regardless of any file extension you supply. If that is what happened, use not do is needed to open the file. If that doesn't work, it is hard to know what you did.
        Sir please see that the file was saved as do
        Attached Files
        Last edited by tauseef ali; 21 Nov 2022, 02:59.

        Comment


        • #5
          Sure; it's called a .do file, but that's not material. You could call a tiger a lion but it is still a tiger.

          Consider this experiment.

          Code:
          . sysuse auto, clear
          (1978 automobile data)
          
          . save auto.do
          file auto.do saved as .dta format
          
          . type auto.do
          <stata_dta><header><release>118</release><byteorder>LSF</byteorder><K>..</K><N>J.......</
          > N><label>..1978 automobile data</label><timestamp>.21 Nov 2022 10:23</timestamp></heade
          > r><map>........�.......-.......f.......�.......�.......u
          ......�.......�.......n$......�0......�0......�1......�1......</map><variable_types>..���
          > �������������������</variable_types><varnames>make.20..................................
          > .......................................................................................
          > .price.s...............................................................................
          > ...........................................mpg.l.......................................
          > .....................................................................................re
          > p78....................................................................................
          > ........................................headroom.......................................
          > ..................................................................................trunk
          > ..n....................................................................................
          > .....................................weight.e..........................................
          > ...............................................................................length..
          > .......................................................................................
          > ..................................turn.ng_circle.......................................
          > ............................................................................displacemen
          > t......................................................................................
          > ...............................gear_ratio..............................................
          > .........................................................................foreign.......
          > .......................................................................................
          > ............................</varnames><sortlist>..........................</sortlist><
          > formats>%-18s.......%8.0gc......%8.0g.......%8.0g................%8.0gc.....%8.0g......
          > .%8.0gc......%8.0g.......%....`..A.%8.0g.....%8.0g.......%6.2f.......%8.0g.............
          > .....%8.0g............................................`..�....%6.1f....................
          > ........................`..�....%8.0g..................................................
          > ..%8.0gc..............................................��.%8.0g........................
          > ............................%8.0g....................................................%8
          > .0g............................................oman..�.%6.2f...........................
          > ..................�...�..%8.0g....................................................</for
          > mats><value_label_names>.ake.n...........................�d..`..��d..`..pae..`..0be..`.
          > .@ae..`.. ie..`...ae..`...�e..`..��e..`..p�e..`..P�e..`..��e..`....ake.................
          > ............D.@`..p�D.@`..�i�..`..�i�..`..�+�..`..�+�..`...;�..`..�?�..`..06�..`.......
          > ......................odel.............................................................
          > .......................................................................................
          > ...................�.......�����������������������������������������������������������
          > �����������������............................................�.......�����������������
          > �����������������������������������������������������������..uration...................
          > ......���������������������������������������������������������������������������������
          > ��������������..ivision.........................���������������������������������������
          > ��������������������������������������������������������..ivision......................
          > ...������������������������������������������������������������������������������������
          > �����������..ivision.........................������������������������������������������
          > �����������������������������������������������������..ips.n...........................
          > ���������������������������������������������������������������������������������������
          > ��������..esno............................���������������������������������������������
          > ��������������������������������������������������.origin...........................���
          > ���������������������������������������������������������������������������������������
          > �����.</value_label_names><variable_labels>Make and model..........................q"�A
          > ....h�G....................Mp$B....P�.....�i�A............h�G............h�G..........
          > ..q"�A....h�G............P�.....�...............��A....xz�G.....�SE....���F....Mp$B...
          > .
          .......h�G............q"�A....h�G....P�.....��SE....................�K�A....
          .......�|�G.....Price.nd model..........................q"�A....h�G....................Mp
          > $B....P�.....�i�A............h�G............h�G............q"�A....h�G............P�
          > .....�...............��A....xz�G.....�SE....���F....Mp$B....
          .......h�G............q"�A....h�G....P�.....��SE....................�K�A....
          .......�|�G.....Mileage (mpg)...........................q"�A....h�G....................Mp
          > $B....P�.....�i�A............h�G............h�G............q"�A....h�G............P�
          > .....�...............��A....xz�G.....�SE....���F....Mp$B....
          .......h�G............q"�A....h�G....P�.....��SE....................�K�A....
          .......�|�G.....Repair record 1978......................q"�A....h�G....................Mp
          > $B....P�.....�i�A............h�G............h�G............q"�A....h�G............P�
          > .....�...............��A....xz�G.....�SE....���F....Mp$B....
          .......h�G............q"�A....h�G....P�.....��SE....................�K�A....
          .......�|�G.....Headroom (in.).978......................q"�A....h�G....................Mp
          > $B....P�.....�i�A............h�G............h�G............q"�A....h�G............P�
          > .....�...............��A....xz�G.....�SE....���F....Mp$B....
          .......h�G............q"�A....h�G....P�.....��SE....................�K�A....
          .......�|�G.....Trunk space (cu. ft.)...................q"�A....h�G....................Mp
          > $B....P�.....�i�A............h�G............h�G............q"�A....h�G............P�
          > .....�...............��A....xz�G.....�SE....���F....Mp$B....
          .......h�G............q"�A....h�G....P�.....��SE....................�K�A....
          .......�|�G.....Weight (lbs.).u. ft.)...................q"�A....h�G....................Mp
          > $B....P�.....�i�A............h�G............h�G............q"�A....h�G............P�
          > .....�...............��A....xz�G.....�SE....���F....Mp$B....
          .......h�G............q"�A....h�G....P�.....��SE....................�K�A....
          .......�|�G.....Length (in.)..u. ft.)...................q"�A....h�G....................Mp
          > $B....P�.....�i�A............h�G............h�G............q"�A....h�G............P�
          > .....�...............��A....xz�G.....�SE....���F....Mp$B....
          .......h�G............q"�A....h�G....P�.....��SE....................�K�A....
          .......�|�G.....Turn circle (ft.).t.)...................q"�A....h�G....................Mp
          > $B....P�.....�i�A............h�G............h�G............q"�A....h�G............P�
          > .....�...............��A....xz�G.....�SE....���F....Mp$B....
          .......h�G............q"�A....h�G....P�.....��SE....................�K�A....
          .......�|�G.....Displacement (cu. in.)..................q"�A....h�G....................Mp
          > $B....P�.....�i�A............h�G............h�G............q"�A....h�G............P�
          > .....�...............��A....xz�G.....�SE....���F....Mp$B....
          .......h�G............q"�A....h�G....P�.....��SE....................�K�A....
          .......�|�G.....Gear ratio.t (cu. in.)..................q"�A....h�G....................Mp
          > $B....P�.....�i�A............h�G............h�G............q"�A....h�G............P�
          > .....�...............��A....xz�G.....�SE....���F....Mp$B....
          .......h�G............q"�A....h�G....P�.....��SE....................�K�A....
          .......�|�G.....Car origin.t (cu. in.)..................q"�A....h�G....................Mp
          > $B....P�.....�i�A............h�G............h�G............q"�A....h�G............P�
          > .....�...............��A....xz�G.....�SE....���F....Mp$B....
          .......h�G............q"�A....h�G....P�.....��SE....................�K�A....
          .......�|�G.....</variable_labels><characteristics><ch>(..._dta..........................
          > .......................................................................................
          > ........notenote1...x%�A....��SE....�.....................</ch>....�NH....t�SE....�p$B
          > ............h�G....(.......................6#�A....�From Consumer Reports with permissi
          > on.</ch><ch>...._dta...................................................................
          > ......................................................notenote0...x%�A....��SE....�...
          > ..................</ch>....�NH....t�SE....�p$B............h�G..........................
          > ..6#�A....�1.</ch><ch>
          ..._dta..................................................................................
          > .......................................note_lang_list.A....��SE....�..................
          > ...</ch>....�NH....t�SE....�p$B............h�G....
          .......................6#�A....�default.</ch><ch>
          ..._dta..................................................................................
          > .......................................note_lang_c.x%�A....��SE....�..................
          > ...</ch>....�NH....t�SE....�p$B............h�G....
          .......................6#�A....�default.</ch></characteristics><data>AMC Concord.�.�..�..
          > ...... @..r.�.(.y.�[email protected] Pacer.d.�.�..��.......@@...
          �.(...��[email protected] Spirit....�...�...�..@@..P
          �.#.y.�[email protected] Century.�..��.......�@..�.�.(.�..�;@.Buick Electra.�..��.......�@..�.�.+
          > .^.q=
          Stata doesn't correct the extension or save your work as a series of commands, if you specify save and a .do extension.

          Perhaps you didn't do that, but you are not telling us what you did type (or specify through the menu), and I don't have any other guesses.

          The question remains: What was the command you used to "save" your work?
          .

          Comment

          Working...
          X