Why is this warnng message displayed?
create table cell_phone
79 as
80 select
81 a.GALC_ACCT_NO as acct_no
82 ,compress(a.GALC_ALRT_PHONE_NO,'-') as cell_nbr
83 from outdata.DMGADR_171212 a
84 join (
85 select
86 b.GALC_ACCT_NO
87 ,max(GALC_LST_UPDT_TS) as last_updt_dt
88 from outdata.DMGADR_171212 b
89 where coalesce(b.GALC_ADDR_TYPE_CD,'')='PHN'
90 and b.GALC_ALRT_PHONE_NO is not null
91 and input(compress(b.GALC_ALRT_PHONE_NO,'-'),10.) > 0
92 group by b.GALC_ACCT_NO
93 ) b on a.GALC_ACCT_NO=b.GALC_ACCT_NO and a.GALC_LST_UPDT_TS=b.last_updt_dt
94 where coalesce(a.GALC_ADDR_TYPE_CD)='PHN'
95 and a.GALC_ALRT_PHONE_NO is not null
96 and input(compress(a.GALC_ALRT_PHONE_NO,'-'),10.) > 0
97 ;
WARNING: INPUT function reported 'WARNING: Illegal first argument to function' while processing WHERE clause.
WARNING: INPUT function reported 'WARNING: Illegal first argument to function' while processing WHERE clause.
WARNING: INPUT function reported 'WARNING: Illegal first argument to function' while processing WHERE clause.
You should use coalescec( ) for character variable, coalesce() is for numeric variable.
but the warning is related to input function.
Have you tried input(compress(b.GALC_ALRT_PHONE_NO,'','KD')) ? 'KD' will keep only numeric characters. There may be other delimiters in your phone data.
Richard in Oz
Will try that!
Thanks.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.