BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kevinma28
Fluorite | Level 6

I am importing a dataset in Enterprise Miner which contains interval values. However, all the decimal points is formatted using ',' as opposed to '.', e.g. "42,0", so it could not accept it as interval. Is there a way to change the formatting of the decimals to '.' and change the nominal to interval variables for all the columns that has this problem?

I have the example dataset attached.

Edit:

I have tried using the SAS code node and inputted this code:

data &EM_EXPORT_TRAIN;
   set &EM_IMPORT_DATA;

   array vars [*] _character_;

   do i = 1 to dim(vars);
      vars[i] = compress(tranwrd(vars[i],"a","X"));
   end;

   drop i;
run;

 It changed all the ',' to '.', however I still do not know how to proceed as the next step shows error and the supposedly numerical variables are still counted as nominal.

1 ACCEPTED SOLUTION

Accepted Solutions
kevinma28
Fluorite | Level 6
I managed to export the resulting data from the SAS code node as a CSV using the Save Data node and import them again. Thank you for all the help.

View solution in original post

6 REPLIES 6
sbxkoenk
SAS Super FREQ

Hello,

 

I can give you the EM code node way to do this, but why aren't you doing this in the normal SAS editor BEFORE "uploading" (importing) the dataset to Enterprise Miner? 

That's way more straightforward. (In EM there's additionally the metadata role that you have to change.)

 

[EDIT] Sorry, not the role --> the measurement scale

 

Good luck,

Koen

kevinma28
Fluorite | Level 6
Sure, editing it outside EM is easier, but I need to show all the processes done to the dataset inside EM.
sbxkoenk
SAS Super FREQ

You will have to make new variables and drop the old ones !

 

With below code :
(but if you want the code to automatically convert hundreds of character variables, you will have to make this dynamic and data driven) :

data temp(drop=old);
    old = '1,61';
    new = input(old,commax5.);
run;

If you do not succeed in doing this in an efficient way (with only a few lines of code for all hundreds of character variables), I will put a program here in the weekend !

 

Koen

kevinma28
Fluorite | Level 6
I'm doing an assignment and I need to show the processes in SAS Enterprise Miner
kevinma28
Fluorite | Level 6
I managed to export the resulting data from the SAS code node as a CSV using the Save Data node and import them again. Thank you for all the help.
sbxkoenk
SAS Super FREQ

Ah OK. Glad it is solved !

 

Sorry, I forgot about this question in the past two weeks.
Do not let it deter you from asking more questions on this data science (or other) board(s).

 

Thanks,

Koen

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 1801 views
  • 0 likes
  • 2 in conversation