Announcement

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

  • Infix Dictionary Question

    I have a question regarding the infix command, and more specifically creating a dictionary to import the data. I currently use Stata 14-MP.

    The data is currently in a .txt file and is in free format. As such I have created a data dictionary name: "/project2/drubin8/Medicare/infile.dct" The text of the file is below:

    infix dictionary {
    str HCPCS_CD 1- 5
    str Modifier 6- 7
    str PRVRD_SP_CD 8- 9
    int Carrier 10- 14
    byte Locality 15- 16
    byte TP_SRV_CD 17
    byte Place_Service 18- 19
    str Modifier2 20- 21
    double Sbt_serv_cnt 22- 35
    double Tot_chrg_amt 36- 48
    double Alw_chrg_amt 49- 61
    double Dnd_serv_cnt 62- 75
    double DND_chrg_amt 76- 88
    double Asgn_serv_cnt 89- 102
    double NCH_pmt_amt 103- 115
    byte ASC_ind 116
    str Error_Ind 117- 118
    str BETOS 119- 121
    }

    I then do the command: infix using "/project2/drubin8/Medicare/infile.dct",using("/project2/drubin8/Medicare/2017_00100.txt")

    However I get the error message:
    file does not contain a dictionary.

    I believe I have the right format but I am unsure of what is wrong with the dictionary as it currently exists.
    I looked at some old posts and made sure that the files were in the same directory and tried to troubleshoot but it won't work.

    Any help/suggestions would be greatly appreciated.

    Thank you.

    Dan


  • #2
    It's unlikely to be this but I see dashes followed by spaces and those spaces aren't part of the specification.

    The bigger deal is that we can't see the data file. It may be too big and contain confidential data, but can you clone it with small fake data and produce a file that reproduces the problem?

    Code:
    infix dictionary {
    str HCPCS_CD 1- 5
    str Modifier 6- 7
    str PRVRD_SP_CD 8- 9
    int Carrier 10- 14
    byte Locality 15- 16
    byte TP_SRV_CD 17
    byte Place_Service 18- 19
    str Modifier2 20- 21
    double Sbt_serv_cnt 22- 35
    double Tot_chrg_amt 36- 48
    double Alw_chrg_amt 49- 61
    double Dnd_serv_cnt 62- 75
    double DND_chrg_amt 76- 88
    double Asgn_serv_cnt 89- 102
    double NCH_pmt_amt 103- 115
    byte ASC_ind 116
    str Error_Ind 117- 118
    str BETOS 119- 121
    }

    Comment


    • #3

      It was actually that. I changed the spaces and the dictionary worked! (Face-palm).

      Thanks nick, much appreciated.

      Dan.


      Comment

      Working...
      X