Hi ,
I am getting blank values in my sbcr_ssn field when i m caluclating it from subsr_id. Can you please help me with quick fix on the substr side?? thanks !!
Also getting note in log :
NOTE: Invalid string. NOTE: Invalid argument to function INPUT. Missing values may be generated. NOTE: Table WORK.MEMBER_INT_CRS created, with 610173 rows and 25 columns.
FYI :Suscr_id in teradata was BIGINT i converted it into Char :
proc sql;
connect to teradata (user="jhk" password="bhgh" server="UDWtest");
create table member_int_crs(drop=med rx mbr_fact_mod_dt REL_CD rename=( rel_cd1=rel_cd )) as
select *,
'C' as source length=1, /* Indentify all records as CIRRUS Membership */
'CIR'||trim(left(cust_seg_nbr)) as cust_detail_ky_char length=20,
case when med = 1 then 'Y' else 'N' end as med_cov_ind length=1,
case when rx = 1 then 'Y' else 'N' end as rx_cov_ind length=1,
substr(SBSCR_ID,3,9) as sbscr_ssn length=9 ,
INPUT(REL_CD,3.) as rel_cd1
from connection to teradata
(select a.mbr_mo,
b.EMPMT_STS_CD as EMP_STATUS, b.REL_CD , a.MDCR_PRI_IND as medicare_ind, a.co_cd, CASE when a.MED_FLG_IND='Y' then 1 else 0 END as med , CASE when a.RX_FLG_IND='Y' then 1 else 0 END as rx , a.CARRIER_NAME, a.FINC_ARNG_CD as fund_arng_cd , 9999 as hmo_acct_div_nbr, a.PRDCT_CD, b.MBR_MOD_DT as mbr_fact_mod_dt, a.SUBSCRIBER_ID (FORMAT 'z(20)') (char(20)) as SBSCR_ID, a.CUST_SEG_NUM as cust_seg_nbr, a.OPT_SEG_ID as optum_seg_id, b.MBR_ID (FORMAT 'z(20)') (char(20)) as clmnt_id, b.Indv_id, b.dob as pat_dob, b.DEPN_NBR, b.ZIP_CD as mbr_zip_cd, b.GENDER_CD as gender,
b.first_name,
b.last_name
from CRMINT.MEMBERSHIP_FACT a
left join CRMINT.MEMBER_LU b
on a.MBR_KEY = b.MBR_KEY
where mbr_mo between &mendstrt. and &mendend. and
a.SRC_ROW_STS_CD IN( 'A') and b.SRC_ROW_STS_CD IN( 'A')
)
order by indv_id, mbr_mo, cust_seg_nbr;
quit;
... View more