BookmarkSubscribeRSS Feed
David_Billa
Rhodochrosite | Level 12

Could you please help me to get rid of this error? CEDED_FLG is a character field.

 

26         proc sql;
27         create table temp as select * from cashflow
28         where CEDED_FLG = “Y/N”;
ERROR: Expression using equals (=) has components that are of different data types.
ERROR: The following columns were not found in the contributing tables: 'N”'n, '“Y'n.
3 REPLIES 3
PeterClemmensen
Tourmaline | Level 20

Your code is fine. The code below runs without errors.

 

However, it seems like CEDED_FLG is a numeric variable.

 

data cashflow;
    CEDED_FLG="Y/N";
run;

proc sql;
create table temp as select * from cashflow
where CEDED_FLG = "Y/N";
quit;
PaigeMiller
Diamond | Level 26

@David_Billa wrote:

Could you please help me to get rid of this error? CEDED_FLG is a character field.

 

26         proc sql;
27         create table temp as select * from cashflow
28         where CEDED_FLG = “Y/N”;
ERROR: Expression using equals (=) has components that are of different data types.
ERROR: The following columns were not found in the contributing tables: 'N”'n, '“Y'n.

In your data set cashflow, CEDED_FLG is not a character variable, it must be a numeric variable.

--
Paige Miller
Tom
Super User Tom
Super User

Looks like you have been bitten by the Microsoft "smart" quotes.  Instead of a quoted string SAS is seeing two goofy variable names being divided.

Use only normal ASCII characters in the code.  Not typesetting characters intended for book publishing.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 475 views
  • 3 likes
  • 4 in conversation