*pbp_mrx.sas;

libname out '.\sas_data_sets\PBP';
options pageno=1 linesize = 200 nocenter;

data pbp_mrx;

length
	pbp_a_hnumber                    $5
	pbp_a_plan_identifier            $3
	pbp_a_ben_cov                    $1
	pbp_a_plan_type                  $2
	part_d_model_demo                $1
	part_d_enhncd_cvrg_demo          $1
	orgtype                          $2
    bid_id                           $13
	mrx_form_model_type 		 $5	
	mrx_drug_ben_yn                  $1
	mrx_benefit_type                 $1
	mrx_partd_network_loc            $6
	mrx_ltc_attest_flag              $1
	mrx_floor_price_yn               $1
	mrx_ceiling_price_yn             $1
	mrx_first_fill                   $1
	mrx_quantity_limits              $1
	mrx_auth_ynba                    $1
	mrx_limit_ofc_yn                 $1
	mrx_step_ther_drugs_yn           $1
	mrx_otc_meds_pay_ump_yn          $1
	mrx_otc_meds_attest_flag         $1
	mrx_otc_step_therapy_yn          $1
	mrx_tier_form_ex                 $1
	mrx_tier_form_ex_2_yn            $1
	mrx_ae_oon_cstshr_struct         $1
	mrx_ae_cstshr_apply              $1
	mrx_form_model_desc              $255
	mrx_ae_ooptcs_apply              $1
	mrx_alt_ded_charge               $1
	mrx_alt_ded_type_yn              $1
	mrx_alt_no_ded_tier              $7
	mrx_alt_ded_tier_cstshr_yn       $1
	mrx_alt_gen_cstshr_struct        $1
	mrx_alt_oon_cstshr_struct        $1
	mrx_alt_red_cost_sharing         $1
	mrx_alt_red_cost_sharing_items   $4
	mrx_alt_excl_drugs_yn            $1
	mrx_alt_gap_covg_yn              $1
	mrx_alt_pre_icl_cost_share       $1
	mrx_alt_pre_icl_exclud_only_yn   $1
	mrx_alt_pre_icl_cost_share_mmp   $1
	mrx_alt_pre_icl_lis_mmp_yn       $1
	mrx_alt_pre_icl_lis_mmp_tiers    $7
	mrx_alt_cov_lmt_yn               $1
	mrx_alt_gap_covg_tier            $7
	mrx_alt_cstshr_post_oopt         $1
	mrx_post_exclud_only_yn          $1
	mrx_alt_cstshr_post_oopt_mmp     $1
	mrx_gen_loc_rstd                 $3
	mrx_gen_loc_oon                  $2
	mrx_gen_loc_mostd                $3
	mrx_gen_loc_ltc                  $1
	mrx_tier_extd_days_gen_yn        $1
	mrx_gen_extd_first_fill          $1
	mrx_avg_exp_cost_share_attest    $1
	mrx_snp_zerocost_attest          $1
	mrx_rai_off_rew_incent_yn        $1
	mrx_rai_num_partd_offrd          $1
	mrx_rai_type_partd_rew_1rx       $4
	max_rai_frq_rew_incent_1rx       $1
	mrx_rai_frq_ri_desc_1rx          $200
	mrx_rai_elig_crit_1rx            $3
	mrx_rai_meet_adh_goal_yn_1rx     $1
	mrx_rai_type_partd_rew_2rx       $4
	max_rai_frq_rew_incent_2rx       $1
	mrx_rai_frq_ri_desc_2rx          $200
	mrx_rai_elig_crit_2rx            $3
	mrx_rai_meet_adh_goal_yn_2rx     $1
	mrx_rai_type_partd_rew_3rx       $4
	max_rai_frq_rew_incent_3rx       $1
	mrx_rai_frq_ri_desc_3rx          $200
	mrx_rai_elig_crit_3rx            $3
	mrx_rai_meet_adh_goal_yn_3rx     $1
	mrx_reduct_cost_yn               $1
	mrx_v_bid_attestation            $1
	mrx_d_pmm_flex_chk               $6
	mrx_d_red_cs_lisb_detail         $1
	mrx_d_ri_type_chk                $4
	mrx_d_ri_type_other              $200
	mrx_d_ri_elig_rdo                $1
	mrx_d_elig_freq_other            $200
	mrx_d_eligcrit_chk               $3
	mrx_d_eligcrit_other             $200
	mrx_d_adher_goal                 $1
	mrx_d_adher_goal_desc            $200
;

infile '.\pbp\pbp_mrx.txt' delimiter = '09'x
dsd lrecl = 30000 firstobs=2 missover;


input
	pbp_a_hnumber
	pbp_a_plan_identifier
	segment_id
	pbp_a_ben_cov
	pbp_a_plan_type
	orgtype
	bid_id
	version
	part_d_model_demo
	part_d_enhncd_cvrg_demo
	mrx_form_model_type
	mrx_drug_ben_yn
	mrx_benefit_type
	mrx_partd_network_loc
	mrx_ltc_attest_flag
	mrx_floor_price_yn
	mrx_ceiling_price_yn
	mrx_first_fill
	mrx_quantity_limits
	mrx_auth_ynba
	mrx_limit_ofc_yn
	mrx_step_ther_drugs_yn
	mrx_otc_meds_pay_ump_yn
	mrx_otc_meds_attest_flag
	mrx_otc_step_therapy_yn
	mrx_formulary_tiers_num
	mrx_tier_form_ex
	mrx_tier_form_ex_2_yn
	mrx_tier_form_ex_2
	mrx_ae_oon_cstshr_struct
	mrx_ae_cstshr_apply
	mrx_form_model_desc
	mrx_ae_ooptcs_apply
	mrx_alt_ded_charge
	mrx_alt_ded_amount
	mrx_alt_ded_type_yn
	mrx_alt_no_ded_tier
	mrx_alt_ded_tier_cstshr_yn
	mrx_alt_gen_cstshr_struct
	mrx_alt_gen_coins_pct
	mrx_alt_gen_copay_amt
	mrx_alt_oon_cstshr_struct
	mrx_alt_red_cost_sharing
	mrx_alt_red_cost_sharing_items
	mrx_alt_excl_drugs_yn
	mrx_alt_gap_covg_yn
	mrx_alt_pre_icl_cost_share
	mrx_alt_pre_icl_exclud_only_yn
	mrx_alt_pre_icl_cost_share_mmp
	mrx_alt_pre_icl_lis_mmp_yn
	mrx_alt_pre_icl_lis_mmp_tiers
	mrx_alt_cov_lmt_yn
	mrx_alt_cov_lmt_amt
	mrx_alt_gap_covg_tier
	mrx_alt_cstshr_post_oopt
	mrx_post_exclud_only_yn
	mrx_alt_cstshr_post_oopt_mmp
	mrx_gen_loc_rstd
	mrx_gen_rstd_1m
	mrx_gen_rstd_2m
	mrx_gen_rstd_3m
	mrx_gen_loc_oon
	mrx_gen_oon_1m
	mrx_gen_oon_os
	mrx_gen_loc_mostd
	mrx_gen_mostd_1m
	mrx_gen_mostd_2m
	mrx_gen_mostd_3m
	mrx_gen_loc_ltc
	mrx_gen_ltc_1m
	mrx_tier_extd_days_gen_yn
	mrx_gen_extd_first_fill
	mrx_avg_exp_cost_share_attest
	mrx_snp_zerocost_attest
	mrx_rai_off_rew_incent_yn
	mrx_rai_num_partd_offrd
	mrx_rai_type_partd_rew_1rx
	max_rai_partd_rew_inc_amt_1rx
	max_rai_frq_rew_incent_1rx
	mrx_rai_frq_ri_desc_1rx
	mrx_rai_elig_crit_1rx
	mrx_rai_meet_adh_goal_yn_1rx
	max_rai_ann_partd_rew_amt_1rx
	mrx_rai_type_partd_rew_2rx
	max_rai_partd_rew_inc_amt_2rx
	max_rai_frq_rew_incent_2rx
	mrx_rai_frq_ri_desc_2rx
	mrx_rai_elig_crit_2rx
	mrx_rai_meet_adh_goal_yn_2rx
	max_rai_ann_partd_rew_amt_2rx
	mrx_rai_type_partd_rew_3rx
	max_rai_partd_rew_inc_amt_3rx
	max_rai_frq_rew_incent_3rx
	mrx_rai_frq_ri_desc_3rx
	mrx_rai_elig_crit_3rx
	mrx_rai_meet_adh_goal_yn_3rx
	max_rai_ann_partd_rew_amt_3rx
	mrx_reduct_cost_yn
	mrx_tier_group_num
	mrx_v_bid_attestation
	mrx_d_pmm_flex_chk
	mrx_d_red_cs_lisb_detail
	mrx_d_ri_type_chk
	mrx_d_ri_type_other
	mrx_d_ri_amt
	mrx_d_ri_elig_rdo
	mrx_d_elig_freq_other
	mrx_d_eligcrit_chk
	mrx_d_eligcrit_other
	mrx_d_adher_goal
	mrx_d_adher_goal_desc
	mrx_d_ri_max_amt
;


label
	pbp_a_hnumber                    = 'H Number'
	pbp_a_plan_identifier            = 'Plan ID'
	segment_id                       = 'Segment ID'
	pbp_a_ben_cov                    = 'Coverage Criteria'
	pbp_a_plan_type                  = 'Plan Type'
	orgtype                          = 'Organization Type'
	bid_id                           = 'Bid ID'
	version                          = 'Version Number'
	part_d_model_demo                = 'Part D Model demonstration (CAT-D)'
	part_d_enhncd_cvrg_demo		 = 'Part D Senior Savings Model'
	mrx_form_model_type              = 'MRX Tier Model Select'
	mrx_drug_ben_yn                  = 'MRx Drug Benefit YN'
	mrx_benefit_type                 = 'MRx Drug Benefit Type'
	mrx_partd_network_loc            = 'MRx PartD Network Location'
	mrx_ltc_attest_flag              = 'LTC Attest Flag'
	mrx_floor_price_yn               = 'Floor Pricing'
	mrx_ceiling_price_yn             = 'Does plan utilize ceiling pric'
	mrx_first_fill                   = 'MRx First Fill'
	mrx_quantity_limits              = 'MRx Quantity limits YN'
	mrx_auth_ynba                    = 'MRx Authorization YN'
	mrx_limit_ofc_yn                 = 'MRx Limit OnForm Covg YN'
	mrx_step_ther_drugs_yn           = 'MRx Step Therapy Drugs YN'
	mrx_otc_meds_pay_ump_yn          = 'MRx OTC Util Mngmt Program'
	mrx_otc_meds_attest_flag         = 'MRx OTC Med Attest Flag'
	mrx_otc_step_therapy_yn          = 'MRx OTC Step Therapy YN'
	mrx_formulary_tiers_num          = 'MRx Formulary Tiers Num'
	mrx_tier_form_ex                 = 'Form Ex Tier'
	mrx_tier_form_ex_2_yn            = 'MRX_EX_2_YN'
	mrx_tier_form_ex_2               = 'MRX_FORM_EX_2_NUM'
	mrx_ae_oon_cstshr_struct         = 'MRx AE Cstshr Structure'
	mrx_ae_cstshr_apply              = 'MRx AE Cstshr Pre-Intl Cov Lmt'
	mrx_form_model_desc              = 'Tier Label Description(s)'
	mrx_ae_ooptcs_apply              = 'MRx AE OOP Threshold Applct'
	mrx_alt_ded_charge               = 'MRx Alt BA Deduct Charged YN'
	mrx_alt_ded_amount               = 'MRx Alt Deductible Amount'
	mrx_alt_ded_type_yn              = 'MRx Alt BA Ded Tier YN'
	mrx_alt_no_ded_tier              = 'MRx Alt Non-Deductible Tiers'
	mrx_alt_ded_tier_cstshr_yn       = 'MRx Alt Tier Deduct Cost Share'
	mrx_alt_gen_cstshr_struct        = 'MRx Alt BA Cstshr Structure'
	mrx_alt_gen_coins_pct            = 'MRx Alt Coins Pct'
	mrx_alt_gen_copay_amt            = 'MRx Alt Copay Amt'
	mrx_alt_oon_cstshr_struct        = 'MRx Alt BA OON Cstshr Struct'
	mrx_alt_red_cost_sharing         = 'MRx Alt Red Cost Sharing'
	mrx_alt_red_cost_sharing_items   = 'MRx Alt Red Cost Sharing Items'
	mrx_alt_excl_drugs_yn            = 'MRx Alt Excluded supp drugs'
	mrx_alt_gap_covg_yn              = 'MRx Alt Add Gap Coverage'
	mrx_alt_pre_icl_cost_share       = 'MRx Alt Cstshr Pre-Int Cov Lmt'
	mrx_alt_pre_icl_exclud_only_yn   = 'Pre ICL Exclud drug only YN'
	mrx_alt_pre_icl_cost_share_mmp   = 'MMP Pre-ICL Cost Share Type'
	mrx_alt_pre_icl_lis_mmp_yn       = 'MMP LIS Cost Sharing YN'
	mrx_alt_pre_icl_lis_mmp_tiers    = 'MMP LIS Cost Share Tiers'
	mrx_alt_cov_lmt_yn               = 'MRx Alt Cov Lmt YN'
	mrx_alt_cov_lmt_amt              = 'MRx Alt Cov Lmt Amt'
	mrx_alt_gap_covg_tier            = 'MRx Alt Gap Tier Cov'
	mrx_alt_cstshr_post_oopt         = 'MRx Alt Cstshr Post OOPT'
	mrx_post_exclud_only_yn          = 'POST OOP Excluded only tier YN'
	mrx_alt_cstshr_post_oopt_mmp     = 'MRx Alt Cstshr Post OOPT MMP'
	mrx_gen_loc_rstd                 = 'MRx Gen INP Location'
	mrx_gen_rstd_1m                  = 'MRx Gen IN 1M Supply Days'
	mrx_gen_rstd_2m                  = 'MRx Gen IN 2M Supply Days'
	mrx_gen_rstd_3m                  = 'MRx Gen IN 3M Supply Days'
	mrx_gen_loc_oon                  = 'Out-of-Network Gen Loc'
	mrx_gen_oon_1m                   = 'MRx Gen OONP 1M Supply Days'
	mrx_gen_oon_os                   = 'MRx Gen OONP Oth Supply Days'
	mrx_gen_loc_mostd                = 'MO Pharmacy Gen Locations'
	mrx_gen_mostd_1m                 = 'MRx Gen MO 1M Supply Days'
	mrx_gen_mostd_2m                 = 'MRx Gen MO 2M Supply Days'
	mrx_gen_mostd_3m                 = 'MRx Gen MO 3M Supply Days'
	mrx_gen_loc_ltc                  = 'LTC Pharmacy 1M Location'
	mrx_gen_ltc_1m                   = 'LTC 1M Day Supply'
	mrx_tier_extd_days_gen_yn        = 'MRx Tier Extended Day Supply'
	mrx_gen_extd_first_fill          = 'MRX DS Extend First Fill'
	mrx_avg_exp_cost_share_attest    = 'MRX Avg Exp Cost Attest'
	mrx_snp_zerocost_attest          = 'MRX SNP Zero Cost Attest'
	mrx_rai_off_rew_incent_yn        = 'RX VIBD Rew and Inc YN'
	mrx_rai_num_partd_offrd          = 'RX VBID RAI Package #'
	mrx_rai_type_partd_rew_1rx       = 'RX VBID RAI 1 Type'
	max_rai_partd_rew_inc_amt_1rx    = 'RX VBID RAI 1 Amount'
	max_rai_frq_rew_incent_1rx       = 'RX VBID RAI 1 Frequency'
	mrx_rai_frq_ri_desc_1rx          = 'VBID RAI D Frequency Desc 1'
	mrx_rai_elig_crit_1rx            = 'RX VBID RAI 1 Elg Crit'
	mrx_rai_meet_adh_goal_yn_1rx     = 'RX VBID RAI 1 Meets Goal'
	max_rai_ann_partd_rew_amt_1rx    = 'RX VBID RAI 1 Max Amount'
	mrx_rai_type_partd_rew_2rx       = 'RX VBID RAI 2 Type'
	max_rai_partd_rew_inc_amt_2rx    = 'RX VBID RAI 2 Amount'
	max_rai_frq_rew_incent_2rx       = 'RX VBID RAI 2 Frequency'
	mrx_rai_frq_ri_desc_2rx          = 'VBID RAI D Frequency Desc 2'
	mrx_rai_elig_crit_2rx            = 'RX VBID RAI 2 Elg Crit'
	mrx_rai_meet_adh_goal_yn_2rx     = 'RX VBID RAI 2 Meets Goal'
	max_rai_ann_partd_rew_amt_2rx    = 'RX VBID RAI 2 Max Amount'
	mrx_rai_type_partd_rew_3rx       = 'RX VBID RAI 3 Type'
	max_rai_partd_rew_inc_amt_3rx    = 'RX VBID RAI 3 Amount'
	max_rai_frq_rew_incent_3rx       = 'RX VBID RAI 3 Frequency'
	mrx_rai_frq_ri_desc_3rx          = 'VBID RAI D Frequency Desc 3'
	mrx_rai_elig_crit_3rx            = 'RX VBID RAI 3 Elg Crit'
	mrx_rai_meet_adh_goal_yn_3rx     = 'RX VBID RAI 3 Meets Goal'
	max_rai_ann_partd_rew_amt_3rx    = 'RX VBID RAI 3 Max Amount'
	mrx_reduct_cost_yn               = 'Rx Vbid YN'
	mrx_tier_group_num               = 'Rx Vbid Num Grps'
	mrx_v_bid_attestation            = 'VBID  Attestation'
	mrx_d_pmm_flex_chk               = 'D model Flexibility Type'
	mrx_d_red_cs_lisb_detail         = 'D model LIS Cst Shr Type'
	mrx_d_ri_type_chk                = 'D model RAI Type'
	mrx_d_ri_type_other              = 'D model RAI Other Type'
	mrx_d_ri_amt                     = 'D model RAE Amount'
	mrx_d_ri_elig_rdo                = 'D model RAI Frequency'
	mrx_d_elig_freq_other            = 'D model RAI Freq Other'
	mrx_d_eligcrit_chk               = 'D model Elig Type'
	mrx_d_eligcrit_other             = 'D model Elig Other'
	mrx_d_adher_goal                 = 'D model Meets Goal'
	mrx_d_adher_goal_desc            = 'D model Goal Desc'
	mrx_d_ri_max_amt                 = 'D model RAI Max Amount'
;

run;

proc sort data = pbp_mrx out=out.pbp_mrx;
  by Pbp_a_hnumber pbp_a_plan_identifier segment_id;
run;

proc print data = out.pbp_mrx(obs = 10);
  title 'pbp_mrx file ';
run;

proc means data = out.pbp_mrx;
  title 'pbp_mrx file ';
run;

proc freq data = out.pbp_mrx;
table
	pbp_a_ben_cov
	pbp_a_plan_type
	orgtype
	mrx_drug_ben_yn
	mrx_benefit_type
	mrx_ltc_attest_flag
	mrx_floor_price_yn
	mrx_ceiling_price_yn
	mrx_first_fill
	mrx_quantity_limits
	mrx_auth_ynba
	mrx_limit_ofc_yn
	mrx_step_ther_drugs_yn
	mrx_otc_meds_pay_ump_yn
	mrx_otc_meds_attest_flag
	mrx_otc_step_therapy_yn
	mrx_tier_form_ex
	mrx_tier_form_ex_2_yn
	mrx_ae_oon_cstshr_struct
	mrx_ae_cstshr_apply
	mrx_ae_ooptcs_apply
	mrx_alt_ded_charge
	mrx_alt_ded_type_yn
	mrx_alt_ded_tier_cstshr_yn
	mrx_alt_gen_cstshr_struct
	mrx_alt_oon_cstshr_struct
	mrx_alt_red_cost_sharing
	mrx_alt_red_cost_sharing_items
	mrx_alt_excl_drugs_yn
	mrx_alt_gap_covg_yn
	mrx_alt_pre_icl_cost_share
	mrx_alt_pre_icl_exclud_only_yn
	mrx_alt_pre_icl_cost_share_mmp
	mrx_alt_pre_icl_lis_mmp_yn
	mrx_alt_cov_lmt_yn
	mrx_alt_cstshr_post_oopt
	mrx_post_exclud_only_yn
	mrx_alt_cstshr_post_oopt_mmp
	mrx_gen_loc_rstd
	mrx_gen_loc_oon
	mrx_gen_loc_mostd
	mrx_gen_loc_ltc
	mrx_tier_extd_days_gen_yn
	mrx_gen_extd_first_fill
	mrx_avg_exp_cost_share_attest
	mrx_snp_zerocost_attest
	mrx_rai_off_rew_incent_yn
	mrx_rai_num_partd_offrd
	mrx_rai_type_partd_rew_1rx
	max_rai_frq_rew_incent_1rx
	mrx_rai_elig_crit_1rx
	mrx_rai_meet_adh_goal_yn_1rx
	mrx_rai_type_partd_rew_2rx
	max_rai_frq_rew_incent_2rx
	mrx_rai_elig_crit_2rx
	mrx_rai_meet_adh_goal_yn_2rx
	mrx_rai_type_partd_rew_3rx
	max_rai_frq_rew_incent_3rx
	mrx_rai_elig_crit_3rx
	mrx_rai_meet_adh_goal_yn_3rx
	mrx_reduct_cost_yn
	mrx_v_bid_attestation
	mrx_d_red_cs_lisb_detail
	mrx_d_ri_type_chk
	mrx_d_ri_elig_rdo
	mrx_d_eligcrit_chk
	mrx_d_adher_goal
/ missing;
run;

proc contents data = out.pbp_mrx;
  title 'pbp_mrx data';
run;
