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
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: