Announcement

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

  • ".dct" data format

    Hello,

    The data that I got from an organization is in ".DCT" fromat. along with a ".DO" file. For every data file eg. for "XYZ.DCT", there is a "XYZ.DO" file. The do file contains codes "infile using...." "save....".
    How can I convert the .DCT data into a useable format. I tried to run the codes in do file still it didn't help.

    Thanks

  • #2
    .DCT is typically a Stata dictionary file which contains specifications for how to read in a text file. Thus, you need the text file(s) in order to actually create a data set. What files does the do-file refer to?

    Comment


    • #3
      There should absolutely no need to convert these files. It sounds as if you should run the .do files, which will infile the datasets (and then presumably do something else).

      Should you wish to save the dataset in some other form, you can naturally do that.

      Your statement "I tried to run the codes in do file still it didn't help" may be intended as an error report, but it doesn't convey much at all. To give precise advice we need to see more exactly what happened and more of the code and/or the dictionary files.
      Last edited by Nick Cox; 22 May 2014, 09:13.

      Comment


      • #4
        The folder contains a description which says: NLSS_STA.ZIP: This archive contains the 76 DCT dictionary files (with variable definitions) and 76 DO files (with label define and label value statements) needed to load the data into STATA.

        However there are many other folders which contains data which I suppose are for spss, sas or other format.

        Comment


        • #5
          I ran the do file and it shows error "file RT001.DAT not found
          dictionary invalid"
          but the file RT001.DAT are there in a different folder. Should I put all the files in a same folder with a same directory and run the codes?


          Comment


          • #6
            It sounds as if you need to unzip the folder and use each .do file to read in each dataset.

            Comment


            • #7
              I have attached the pictures of how the data file looks... the data are unzipped.

              I could not help myself with my inexperienced knowledge in stata

              Comment


              • #8
                You need to do one of the following:
                1. Put the .DAT files in the same folder as the .DO and .DCT files.
                2. Modify each of the .DO files to refer to the correct folder. In other words, where the .DO file says "infile using RT001.DAT" change it to "infile using <correct folder>/RT001.DAT".
                3. Change the working directory to the folder where the .DAT files are located (cd <folder containing .DAT files>) and run the .DO files from there. However that may mess up the references to the .DCT files.

                If you have 76 files, I would suggest #3 or #1 if that doesn't work.

                Comment


                • #9
                  Thank you very much for your help.

                  Comment


                  • #10
                    I am having a similar issue, except all my files are in the same folder. Any other suggestions would be greatly appreciated!

                    Comment


                    • #11
                      Ashley: Either the advice above is what you should follow, or your problem is different, in which case you need to explain what is different. Files being in the same folder doesn't complicate anything.

                      Comment


                      • #12
                        Nick, I am using the public-use data from the ECLS-K survey. I have installed the program provided from NCES to create taglists and have extracted the taglist into Stata. Once extracted into Stata I open the test .do file (first picture I have attached to show all files are located in the same folder) and see directions on how to use it correctly (second picture I have attached). When I attempt to follow the directions I keep getting the error message file "C:\childK1p.dat not found dictionary invalid r(614)." I am very new to Stata so I may be making a very simple mistake that I am just not catching. I appreciate your help!
                        Attached Files

                        Comment


                        • #13
                          I don't understand all of this: any such dataset is far from familiar to all Stata users.

                          You are not showing us the .dct file in question, but on the face of it the problem is that Stata can't find a file in your c:\ directory. Indeed that is correct; your own listing shows that it is somewhere else and you need to edit the dictionary accordingly.

                          Please show CODE listings, not screen shots. This is explained in the FAQ Advice you were asked to read before posting.

                          Comment


                          • #14
                            You may have to edit the path to the DAT file in the DCT file. The DCT file can be opened in a text editor.

                            Comment


                            • #15
                              Friedrich I would have never thought to try that as I'm very inexperienced when it comes to Stata, but it worked! Thanks so much for your help!

                              Comment

                              Working...
                              X