BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8

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.

4 REPLIES 4
Ksharp
Super User

You should use coalescec( ) for character variable, coalesce() is for numeric variable.

SASPhile
Quartz | Level 8

but the warning is related to input function.

RichardinOz
Quartz | Level 8

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

SASPhile
Quartz | Level 8

Will try that!

Thanks.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2168 views
  • 1 like
  • 3 in conversation