BookmarkSubscribeRSS Feed
sasuser12321
Calcite | Level 5

Hi all!

 

So, I'm trying to import some datasets in SAS and join them, the only problem is that I get this error after joining them - 

 

 

proc import datafile='filepath/datasetA.csv'
out = dataA
dbms= csv
replace;
run;


proc import datafile='filepath\datasetB.csv'
out = dataB
dbms= csv
replace;
run;



/* combine them all into one dataset*/


data DataC;
set &dataA. &dataB;

run;



ERROR: Variable column_k has been defined as both character and numeric.

 

 

The column in question looks something like this in both of the data sets that I'm trying to join - 

 

column_k

0

1

5

4

NA

NA

4

3

NA

 

etc..

 

Basically, I would like to import the NA data in that column as 'missing', if that's possible? I need the entire column to remain numeric as I'm planning on doing some mathematical stuff with the data in that column further down the line.

 

Thanks for your help!

1 REPLY 1
unison
Lapis Lazuli | Level 10

Take a look here:https://communities.sas.com/t5/SAS-Programming/Importing-a-CSV-file-from-R-with-NA-s-as-missing/td-p...

and see if this solves the problem you're having.

-unison

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

Register now!

What is Bayesian Analysis?

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 1 reply
  • 1521 views
  • 0 likes
  • 2 in conversation