Hello Bossman Chris,

I have a question if I have a variable (ActiveAccount) with my custom Y/N format/informat (see below), why does PROC SQL not implicitly convert the value for me? Why must I use INPUT/PUT?

WHERE
t1.ActiveAccount eq "N"
ERROR: Expression using equals (=) has components that are of different data types.
/* works fine: t1.ActiveAccount eq INPUT("N", YesNoIndicator.) */
/* works fine: PUT(t1.ActiveAccount, YesNoIndicator.) eq "N" */

James

PROC DATASETS output
NAME: ActiveAccount
TYPE: 1 (Numeric)
LENGTH: 8
VARNUM: 30
LABEL: ActiveAccount
FORMAT: YESNOINDICATOR
FORMATL: 0
FORMATD: 0
INFORMAT: YESNOINDICATOR
INFORML: 0
INFORMD: 0

PROC FORMAT LIB=WORK;
VALUE YesNoIndicator ( DEFAULT = 1 )
1 = 'Y'
0 = 'N'
. = _SAME_
OTHER = '?';
INVALUE YesNoIndicator ( UPCASE DEFAULT = 1 )
'Y' = 1
'N' = 0
. = _SAME_
OTHER = _ERROR_;
RUN;