/*Published: 12/1/2020*/
/*                                                                     */
/**********************   COMMENTS   ***********************************/
/*                                                                     */
/* Please Note: If you are using PC SAS to read in these files you     */
/* will have to un-zip the files first and use the un-zipped filename  */
/* statement, rather than using the zipped files and statement.        */
/*                                                                     */
/* This version is for the Part D Prescriber files for 2007-2013.      */
/*                                                                     */
/***********************************************************************/

*filename prscrbin '/directory/prscrbr2013.txt';                      /*reading in an un-zipped file*/
*filename prscrbin pipe 'gunzip -c /directory/prscrbr2013.txt.gz';     /*reading in a zipped file*/
filename prscrbin pipe 'gunzip -c /directory/prscrbr*.txt.gz';     /*using wildcard to match multiple files */

options nocenter validvarname=upcase;

data prescriber;
  infile prscrbin lrecl=338 missover pad;
  input @001   CCW_PRSCRBR_ID                   12.         /*  Encrypted  */
        @013   PRIMARY_TAXONOMY_CD              $char10.
        @023   PRIMARY_TAXONOMY_DESC            $char250.
        @273   OTHER_TAXONOMY_CLASS01           $char4.
        @277   OTHER_TAXONOMY_CLASS02           $char4.
        @281   OTHER_TAXONOMY_CLASS03           $char4.
        @285   OTHER_TAXONOMY_CLASS04           $char4.
        @289   PRACTICE_LOC_STATE01             $char2.
        @291   PRACTICE_LOC_STATE02             $char2.
        @293   PRACTICE_LOC_STATE03             $char2.
        @295   PRACTICE_LOC_STATE04             $char2.
        @297   PRACTICE_LOC_STATE05             $char2.
        @299   CREDENTIAL01                     $char8.
        @307   CREDENTIAL02                     $char8.
        @315   CREDENTIAL03                     $char8.
        @323   CREDENTIAL04                     $char8.
        @331   CREDENTIAL05                     $char8.
     ;

  label  CCW_PRSCRBR_ID                   = "CCW Prescriber ID"
         PRIMARY_TAXONOMY_CD              = "Primary Taxonomy Code"
         PRIMARY_TAXONOMY_DESC            = "Primary Taxonomy Code Description"
         OTHER_TAXONOMY_CLASS01           = "Other Taxonomy Classification - 1"
         OTHER_TAXONOMY_CLASS02           = "Other Taxonomy Classification - 2"
         OTHER_TAXONOMY_CLASS03           = "Other Taxonomy Classification - 3"
         OTHER_TAXONOMY_CLASS04           = "Other Taxonomy Classification - 4"
         PRACTICE_LOC_STATE01             = "Practice Location State - 1"
         PRACTICE_LOC_STATE02             = "Practice Location State - 2"
         PRACTICE_LOC_STATE03             = "Practice Location State - 3"
         PRACTICE_LOC_STATE04             = "Practice Location State - 4"
         PRACTICE_LOC_STATE05             = "Practice Location State - 5"
         CREDENTIAL01                     = "Academic or Professional Credential - 1"
         CREDENTIAL02                     = "Academic or Professional Credential - 2"
         CREDENTIAL03                     = "Academic or Professional Credential - 3"
         CREDENTIAL04                     = "Academic or Professional Credential - 4"
         CREDENTIAL05                     = "Academic or Professional Credential - 5"
     ;
run;

proc contents data=prescriber position;
run;
