*pbp_mrx_tier.sas;

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

data pbp_mrx_tier;

length
	pbp_a_hnumber                    $5
	pbp_a_plan_identifier            $3
	pbp_a_ben_cov                    $1
	pbp_a_plan_type                  $2
	orgtype                          $2
	bid_id                           $13
	mrx_tier_id                      $1
	mrx_tier_benefit_type            $1
	mrx_tier_type_id                 $1
	mrx_tier_drug_type               $6
	mrx_tier_includes                $1
	mrx_tier_inject_yn               $1
	mrx_tier_spec_yn                 $1
	mrx_tier_excep_yn                $1
	mrx_tier_label_list              $2
	mrx_tier_locat                   $21
	mrx_tier_extd_days_yn            $1
	mrx_tier_cstshr_struct_type      $1
	mrx_tier_gap_cost_share          $1
	mrx_tier_alt_gap_covg_excl_yn    $1
	mrx_tier_gap_excluded_only_yn    $1
;

infile '.\pbp\pbp_mrx_tier.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
	mrx_tier_id
	mrx_tier_benefit_type
	mrx_tier_type_id
	mrx_tier_drug_type
	mrx_tier_includes
	mrx_tier_inject_yn
	mrx_tier_spec_yn
	mrx_tier_excep_yn
	mrx_tier_label_list
	mrx_tier_locat
	mrx_tier_inp_1m_num
	mrx_tier_inp_3m_num
	mrx_tier_inp_othnum
	mrx_tier_inpp_1m_num
	mrx_tier_inpp_3m_num
	mrx_tier_inpp_othnum
	mrx_tier_innpp_1m_num
	mrx_tier_innpp_3m_num
	mrx_tier_innpp_othnum
	mrx_tier_oonp_1m_num
	mrx_tier_oonp_othnumn
	mrx_tier_mo_1m_num
	mrx_tier_mo_3m_num
	mrx_tier_mo_othnum
	mrx_tier_mopp_1m_num
	mrx_tier_mopp_3m_num
	mrx_tier_mopp_othnum
	mrx_tier_monpp_1m_num
	mrx_tier_monpp_3m_num
	mrx_tier_monpp_othnum
	mrx_tier_ltcp_1m
	mrx_tier_extd_days_yn
	mrx_tier_cstshr_struct_type
	mrx_tier_inp_coins_1m
	mrx_tier_inp_coins_3m
	mrx_tier_inp_coins_othnum
	mrx_tier_inpp_coins_1m
	mrx_tier_inpp_coins_3m
	mrx_tier_inpp_coins_othnum
	mrx_tier_innpp_coins_1m
	mrx_tier_innpp_coins_3m
	mrx_tier_innpp_coins_othnum
	mrx_tier_oonp_coins_1m
	mrx_tier_oonp_coins_othnum
	mrx_tier_mo_coins_1m
	mrx_tier_mo_coins_3m
	mrx_tier_mo_coins_othnum
	mrx_tier_mopp_coins_1m
	mrx_tier_mopp_coins_3m
	mrx_tier_mopp_coins_othnum
	mrx_tier_monpp_coins_1m
	mrx_tier_monpp_coins_3m
	mrx_tier_monpp_coins_othnum
	mrx_tier_ltcp_coins_1m
	mrx_tier_inp_copay_1m
	mrx_tier_inp_copay_3m
	mrx_tier_inp_copay_othnum
	mrx_tier_inpp_copay_1m
	mrx_tier_inpp_copay_3m
	mrx_tier_inpp_copay_othnum
	mrx_tier_innpp_copay_1m
	mrx_tier_innpp_copay_3m
	mrx_tier_innpp_copay_othnum
	mrx_tier_oonp_copay_1m
	mrx_tier_oonp_copay_othnum
	mrx_tier_mo_copay_1m
	mrx_tier_mo_copay_3m
	mrx_tier_mo_copay_othnum
	mrx_tier_mopp_copay_1m
	mrx_tier_mopp_copay_3m
	mrx_tier_mopp_copay_othnum
	mrx_tier_monpp_copay_1m
	mrx_tier_monpp_copay_3m
	mrx_tier_monpp_copay_othnum
	mrx_tier_ltcp_copay_1m
	mrx_tier_gap_cost_share
	mrx_tier_alt_gap_covg_excl_yn
	mrx_tier_gap_excluded_only_yn
;


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'
	mrx_tier_id                      = 'MRx Tier ID'
	mrx_tier_benefit_type            = 'MRx Drug Benefit Type - Tier'
	mrx_tier_type_id                 = 'MRx Tier Type ID'
	mrx_tier_drug_type               = 'MRx Tier Drug Types'
	mrx_tier_includes                = 'MRx Tier Includes'
	mrx_tier_inject_yn               = 'MRx Inject Drugs Only Tier YN'
	mrx_tier_spec_yn                 = 'MRx Specialty Tier'
	mrx_tier_excep_yn                = 'MRx Exceptions Tier'
	mrx_tier_label_list              = 'MRx Tier Label Selection'
	mrx_tier_locat                   = 'MRx Group Location'
	mrx_tier_inp_1m_num              = 'MRx Tier INP 1M Supply Days'
	mrx_tier_inp_3m_num              = 'MRx Tier INP 3M Supply Days'
	mrx_tier_inp_othnum              = 'MRx Tier INP Oth Supply Days'
	mrx_tier_inpp_1m_num             = 'MRx Tier INPP 1M Supply Days'
	mrx_tier_inpp_3m_num             = 'MRx Tier INPP 3M Supply Days'
	mrx_tier_inpp_othnum             = 'MRx Tier INPP Oth Supply Days'
	mrx_tier_innpp_1m_num            = 'MRx Tier INNPP 1M Supply Days'
	mrx_tier_innpp_3m_num            = 'MRx Tier INNPP 3M Supply Days'
	mrx_tier_innpp_othnum            = 'MRx Tier INNPP Oth Supply Days'
	mrx_tier_oonp_1m_num             = 'MRx Tier OONP 1M Supply Days'
	mrx_tier_oonp_othnumn            = 'MRx Tier OONP Oth Supply Days'
	mrx_tier_mo_1m_num               = 'MRx Tier MO 1M Supply Days'
	mrx_tier_mo_3m_num               = 'MRx Tier MO 3M Supply Days'
	mrx_tier_mo_othnum               = 'MRx Tier MO Oth Supply Days'
	mrx_tier_mopp_1m_num             = 'MRx Tier MOPP 1M Supply Days'
	mrx_tier_mopp_3m_num             = 'MRx Tier MOPP 3M Supply Days'
	mrx_tier_mopp_othnum             = 'MRx Tier MOPP Oth Supply Days'
	mrx_tier_monpp_1m_num            = 'MRx Tier MONPP 1M Supply Days'
	mrx_tier_monpp_3m_num            = 'MRx Tier MONPP 3M Supply Days'
	mrx_tier_monpp_othnum            = 'MRx Tier MONPP Oth Supply Days'
	mrx_tier_ltcp_1m                 = 'MRx Tier LTCP 1M Supply Days'
	mrx_tier_extd_days_yn            = 'MRx Tier Extended Day Supply'
	mrx_tier_cstshr_struct_type      = 'MRx Cost Share Tier Struct'
	mrx_tier_inp_coins_1m            = 'MRx Tier INP Coins 1M'
	mrx_tier_inp_coins_3m            = 'MRx Tier INP Coins 3M'
	mrx_tier_inp_coins_othnum        = 'MRx Tier INP Coins Oth'
	mrx_tier_inpp_coins_1m           = 'MRx Tier INPP Coins 1M'
	mrx_tier_inpp_coins_3m           = 'MRx Tier INPP Coins 3M'
	mrx_tier_inpp_coins_othnum       = 'MRx Tier INPP Coins Oth'
	mrx_tier_innpp_coins_1m          = 'MRx Tier INNPP Coins 1M'
	mrx_tier_innpp_coins_3m          = 'MRx Tier INNPP Coins 3M'
	mrx_tier_innpp_coins_othnum      = 'MRx Tier INNPP Coins Oth'
	mrx_tier_oonp_coins_1m           = 'MRx Tier OONP Coins 1M'
	mrx_tier_oonp_coins_othnum       = 'MRx Tier OONP Coins Oth'
	mrx_tier_mo_coins_1m             = 'MRx Tier MO Coins 1M'
	mrx_tier_mo_coins_3m             = 'MRx Tier MO Coins 3M'
	mrx_tier_mo_coins_othnum         = 'MRx Tier MO Coins Oth'
	mrx_tier_mopp_coins_1m           = 'MRx Tier MOPP Coins 1M'
	mrx_tier_mopp_coins_3m           = 'MRx Tier MOPP Coins 3M'
	mrx_tier_mopp_coins_othnum       = 'MRx Tier MOPP Coins Oth'
	mrx_tier_monpp_coins_1m          = 'MRx Tier MONPP Coins 1M'
	mrx_tier_monpp_coins_3m          = 'MRx Tier MONPP Coins 3M'
	mrx_tier_monpp_coins_othnum      = 'MRx Tier MONPP Coins Oth'
	mrx_tier_ltcp_coins_1m           = 'MRx Tier LTCP Coins 1M'
	mrx_tier_inp_copay_1m            = 'MRx Tier INP Copay 1M'
	mrx_tier_inp_copay_3m            = 'MRx Tier INP Copay 3M'
	mrx_tier_inp_copay_othnum        = 'MRx Tier INP Copay Oth'
	mrx_tier_inpp_copay_1m           = 'MRx Tier INPP Copay 1M'
	mrx_tier_inpp_copay_3m           = 'MRx Tier INPP Copay 3M'
	mrx_tier_inpp_copay_othnum       = 'MRx Tier INPP Copay Oth'
	mrx_tier_innpp_copay_1m          = 'MRx Tier INNPP Copay 1M'
	mrx_tier_innpp_copay_3m          = 'MRx Tier INNPP Copay 3M'
	mrx_tier_innpp_copay_othnum      = 'MRx Tier INNPP Copay Oth'
	mrx_tier_oonp_copay_1m           = 'MRx Tier OONP Copay 1M'
	mrx_tier_oonp_copay_othnum       = 'MRx Tier OONP Copay Oth'
	mrx_tier_mo_copay_1m             = 'MRx Tier MO Copay 1M'
	mrx_tier_mo_copay_3m             = 'MRx Tier MO Copay 3M'
	mrx_tier_mo_copay_othnum         = 'MRx Tier MO Copay Oth'
	mrx_tier_mopp_copay_1m           = 'MRx Tier MOPP Copay 1M'
	mrx_tier_mopp_copay_3m           = 'MRx Tier MOPP Copay 3M'
	mrx_tier_mopp_copay_othnum       = 'MRx Tier MOPP Copay Oth'
	mrx_tier_monpp_copay_1m          = 'MRx Tier MONPP Copay 1M'
	mrx_tier_monpp_copay_3m          = 'MRx Tier MONPP Copay 3M'
	mrx_tier_monpp_copay_othnum      = 'MRx Tier MONPP Copay Oth'
	mrx_tier_ltcp_copay_1m           = 'MRx Tier LTCP Copay Oth'
	mrx_tier_gap_cost_share          = 'MRx Tier Gap Cost Share'
	mrx_tier_alt_gap_covg_excl_yn    = 'MRx Alt Gap Cov Excl YN'
	mrx_tier_gap_excluded_only_yn    = 'MRx Alt Gap Cov Excl Only YN'
;

run;

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

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

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

proc freq data = out.pbp_mrx_tier;
table
	pbp_a_ben_cov
	pbp_a_plan_type
	orgtype
	mrx_tier_id
	mrx_tier_benefit_type
	mrx_tier_type_id
	mrx_tier_includes
	mrx_tier_inject_yn
	mrx_tier_spec_yn
	mrx_tier_excep_yn
	mrx_tier_label_list
	mrx_tier_extd_days_yn
	mrx_tier_cstshr_struct_type
	mrx_tier_gap_cost_share
	mrx_tier_alt_gap_covg_excl_yn
	mrx_tier_gap_excluded_only_yn
/ missing;
run;

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