I am trying to add two new rows into my table. There is no value for either player for a salary column. This is the code I have been trying but it is giving me an error, saying "It is invalid to assign a character expression to a numeric value using the SET clause.
PROC sql;
INSERT into work.baseball2
SET name='Babe Ruth', team='New York', league='American', YrMajor='22', CrAtBat='8399', CrHits='2873', CrHome='714', CrRuns='1416', CrRbi='1305', CrBB='621', position='left fielder'
SET name='Roberto Clemente', team='Pittsburgh', league='National', YrMajor='18', CrAtBat='9454', CrHits='3000', CrHome='240', CrRuns='1416', CrRbi='1305', CrBB='621', position='right fielder';
SELECT * from work.baseball2;
quit;
Hello,
The note is very clear here, your are trying to give characters values instead of numeric values.
'22' ---> This is character
22 ---> This is numeric, avoid using the quotes.
First check which columns are numeric and which are characters by any of these:
- Describe table
- proc datasets
- dictionary tables
Hello,
The note is very clear here, your are trying to give characters values instead of numeric values.
'22' ---> This is character
22 ---> This is numeric, avoid using the quotes.
First check which columns are numeric and which are characters by any of these:
- Describe table
- proc datasets
- dictionary tables
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.