<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Blank value coming in substring field in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798824#M314038</link>
    <description>I didn't mentioned the code complete. but i m passing REL_CD, i will update the query .&lt;BR /&gt;&lt;BR /&gt;my issue is my subsr_ssn are coming blank but in source subsrciber_id is populated.</description>
    <pubDate>Sat, 26 Feb 2022 11:21:26 GMT</pubDate>
    <dc:creator>librasonali</dc:creator>
    <dc:date>2022-02-26T11:21:26Z</dc:date>
    <item>
      <title>Blank value coming in substring field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798816#M314030</link>
      <description>&lt;P&gt;Hi&amp;nbsp; ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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 !!&lt;/P&gt;
&lt;P&gt;Also getting note in log :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;NOTE: Invalid string.&lt;BR /&gt;NOTE: Invalid argument to function INPUT. Missing values may be generated.&lt;BR /&gt;NOTE: Table WORK.MEMBER_INT_CRS created, with 610173 rows and 25 columns.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;FYI :Suscr_id in teradata was BIGINT i converted it into Char :&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;EM&gt;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,
            &lt;STRONG&gt;substr(SBSCR_ID,3,9) as sbscr_ssn length=9&lt;/STRONG&gt; ,
             INPUT(REL_CD,3.) as rel_cd1
			
      from connection to teradata
      (select a.mbr_mo,
              b.EMPMT_STS_CD as EMP_STATUS,&lt;BR /&gt;b.REL_CD ,&lt;BR /&gt;a.MDCR_PRI_IND as medicare_ind,&lt;BR /&gt;a.co_cd,&lt;BR /&gt;CASE when a.MED_FLG_IND='Y' then 1&lt;BR /&gt;else 0&lt;BR /&gt;END as med ,&lt;BR /&gt;CASE when a.RX_FLG_IND='Y' then 1&lt;BR /&gt;else 0&lt;BR /&gt;END as rx ,&lt;BR /&gt;a.CARRIER_NAME,&lt;BR /&gt;a.FINC_ARNG_CD as fund_arng_cd ,&lt;BR /&gt;9999 as hmo_acct_div_nbr,&lt;BR /&gt;a.PRDCT_CD,&lt;BR /&gt;b.MBR_MOD_DT as mbr_fact_mod_dt,&lt;BR /&gt;a.SUBSCRIBER_ID (FORMAT 'z(20)') (char(20)) as SBSCR_ID,&lt;BR /&gt;a.CUST_SEG_NUM as cust_seg_nbr,&lt;BR /&gt;a.OPT_SEG_ID as optum_seg_id,&lt;BR /&gt;b.MBR_ID (FORMAT 'z(20)') (char(20)) as clmnt_id,&lt;BR /&gt;b.Indv_id,&lt;BR /&gt;b.dob as pat_dob,&lt;BR /&gt;b.DEPN_NBR,&lt;BR /&gt;b.ZIP_CD as mbr_zip_cd,&lt;BR /&gt;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 &amp;amp;mendstrt. and &amp;amp;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;&lt;/EM&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 11:22:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798816#M314030</guid>
      <dc:creator>librasonali</dc:creator>
      <dc:date>2022-02-26T11:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Blank value coming in substring field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798818#M314032</link>
      <description>&lt;P&gt;Your issue is not with the SUBSTR, it's with the INPUT function, so it happens here:&lt;/P&gt;
&lt;PRE&gt;INPUT(REL_CD,3.) as rel_cd1&lt;/PRE&gt;
&lt;P&gt;Your explicit pass-through does not deliver a column named REL_CD.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/345043"&gt;@librasonali&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi&amp;nbsp; ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;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 !!&lt;/P&gt;
&lt;P&gt;Also getting note in log :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;NOTE: Invalid string.&lt;BR /&gt;NOTE: Invalid argument to function INPUT. Missing values may be generated.&lt;BR /&gt;NOTE: Table WORK.MEMBER_INT_CRS created, with 610173 rows and 25 columns.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;FYI :Suscr_id in teradata was BIGINT i converted it into Char :&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;EM&gt;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,
            &lt;STRONG&gt;substr(SBSCR_ID,3,9) as sbscr_ssn length=9&lt;/STRONG&gt; ,
             INPUT(REL_CD,3.) as rel_cd1
			
      from connection to teradata
      (select a.mbr_mo,
              b.EMPMT_STS_CD as EMP_STATUS,
              
              b.MBR_MOD_DT as mbr_fact_mod_dt,
              &lt;STRONG&gt;a.SUBSCRIBER_ID (FORMAT 'z(21)') (char(21)) as  SBSCR_ID,&lt;/STRONG&gt;
              a.CUST_SEG_NUM  as cust_seg_nbr,
              a.OPT_SEG_ID  as optum_seg_id,
              b.MBR_ID (FORMAT 'z(21)') (char(21)) 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 &amp;amp;mendstrt. and &amp;amp;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;&lt;/EM&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 09:43:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798818#M314032</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-26T09:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Blank value coming in substring field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798824#M314038</link>
      <description>I didn't mentioned the code complete. but i m passing REL_CD, i will update the query .&lt;BR /&gt;&lt;BR /&gt;my issue is my subsr_ssn are coming blank but in source subsrciber_id is populated.</description>
      <pubDate>Sat, 26 Feb 2022 11:21:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798824#M314038</guid>
      <dc:creator>librasonali</dc:creator>
      <dc:date>2022-02-26T11:21:26Z</dc:date>
    </item>
    <item>
      <title>Re: Blank value coming in substring field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798830#M314041</link>
      <description>&lt;P&gt;This&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;NOTE: Invalid argument to function INPUT. Missing values may be generated.&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;complains about the INPUT function, so this needs to be fixed as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run your code without the SUBSTR function to see which values you actually get from the DB.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 11:38:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798830#M314041</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-26T11:38:34Z</dc:date>
    </item>
    <item>
      <title>Re: Blank value coming in substring field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798833#M314044</link>
      <description>&lt;P&gt;I am getting below values in SBSCR_ID from table member_int_crs &lt;BR /&gt;Character format length 20&lt;BR /&gt;SBSCR_ID&lt;BR /&gt;2696942&lt;BR /&gt;488882983&lt;BR /&gt;&lt;BR /&gt;and from teradata , BIGINT format length 19&lt;BR /&gt;SUBSCRIBER_ID&lt;BR /&gt;633735&lt;BR /&gt;201548&lt;BR /&gt;618887&lt;BR /&gt;// same type of values if in source its 633735 then in&amp;nbsp;member_int_crs also its same.&lt;BR /&gt;and also how shd i fix this then?&lt;BR /&gt;NOTE: Invalid argument to function INPUT. Missing values may be generated.&lt;BR /&gt;for&amp;nbsp;REL_CD i am getting correct value.. just the format is getting changed from char to Num&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 11:55:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798833#M314044</guid>
      <dc:creator>librasonali</dc:creator>
      <dc:date>2022-02-26T11:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Blank value coming in substring field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798838#M314047</link>
      <description>&lt;P&gt;So it looks like your cast in Teradata is incorrect, as the values are changed.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 12:40:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798838#M314047</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-26T12:40:26Z</dc:date>
    </item>
    <item>
      <title>Re: Blank value coming in substring field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798839#M314048</link>
      <description>no no .&lt;BR /&gt;&lt;BR /&gt; am getting below values in SBSCR_ID from table member_int_crs&lt;BR /&gt;Character format length 20&lt;BR /&gt;SBSCR_ID&lt;BR /&gt;2696942&lt;BR /&gt;488882983&lt;BR /&gt;&lt;BR /&gt;and from teradata , BIGINT format length 19&lt;BR /&gt;SUBSCRIBER_ID&lt;BR /&gt;2696942&lt;BR /&gt;488882983&lt;BR /&gt;&lt;BR /&gt;// same type of values if in source its 633735 then in member_int_crs also its same.. &lt;BR /&gt;&lt;BR /&gt;issue is with sbscr_ssn , how its coming blank ? where as subs_id is coming fine .</description>
      <pubDate>Sat, 26 Feb 2022 13:27:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798839#M314048</guid>
      <dc:creator>librasonali</dc:creator>
      <dc:date>2022-02-26T13:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Blank value coming in substring field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798861#M314055</link>
      <description>&lt;P&gt;Use&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;substr(left(SBSCR_ID),3,9)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and see what happens.&lt;/P&gt;
&lt;P&gt;Casts of numeric to character are usually right-aligned.&lt;/P&gt;</description>
      <pubDate>Sat, 26 Feb 2022 16:35:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798861#M314055</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-02-26T16:35:08Z</dc:date>
    </item>
    <item>
      <title>Re: Blank value coming in substring field</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798865#M314056</link>
      <description>now it's working !! &lt;BR /&gt;if SUBSCRIBER_ID is 633735 then subscr_ssn is 3735 , which was excepted. &lt;BR /&gt;</description>
      <pubDate>Sat, 26 Feb 2022 17:01:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Blank-value-coming-in-substring-field/m-p/798865#M314056</guid>
      <dc:creator>librasonali</dc:creator>
      <dc:date>2022-02-26T17:01:42Z</dc:date>
    </item>
  </channel>
</rss>

