Learning SAS? Welcome to the exclusive online community for all SAS learners.

log transform proc import data on mac virtual box environment

Reply
Occasional Contributor
Posts: 6

log transform proc import data on mac virtual box environment

I'm trying to the following code in the latest SAS University Edition and I just get '.' for the new log transformed column. The code works if the data is under a datalines statement. Any help would be appreciated.

 

filename REFFILE "/folders/myshortcuts/stats1/unit3/EducationData.xlsx" termstr=CR;
proc import datafile=REFFILE
dbms=XLSX
out=incomedata
replace;
getnames=YES;
run;
proc print data=incomedata(obs=10);
run;

data lndata;
set incomedata;
lnIncome = log(income);
proc print data=lndata;
run;
Super Contributor
Posts: 490

Re: log transform proc import data on mac virtual box environment

 

Could you run 

proc contents data= lndata ;
run;

and post the "Alphabetic List of Variables and Attributes" table output

 

Occasional Contributor
Posts: 6

Re: log transform proc import data on mac virtual box environment

I did modify the income variable name to the one in the Excel file, Income2005. It still didn't work. Here is the output your requested.

 


Picture1.png
Super User
Posts: 17,819

Re: log transform proc import data on mac virtual box environment

Post your full log, the proc contents isn't indicating any issues.

 

Is your log error free up to that point?

Occasional Contributor
Posts: 6

Re: log transform proc import data on mac virtual box environment

Well, it seems to be working now. Hmm. Sorry for the run around. My first post to this forum. Thanks for the replies.

Community Manager
Posts: 552

Re: log transform proc import data on mac virtual box environment

Hi @chopper, thanks for finding and using this forum! Lots of wisdom in here. Keep coming back.

Super User
Posts: 17,819

Re: log transform proc import data on mac virtual box environment

Please post your log if you're encountering errors. 

 

Most likely the cause is something ahead of the data step, in the proc import.

 

My guess would be the variable isn't actually called income, but is something else in the Excel file. 

Running a proc contents as @mohamed_zaki has indicated will show you the variable name and label. Make sure you're using the variable name.

Ask a Question
Discussion stats
  • 6 replies
  • 456 views
  • 1 like
  • 4 in conversation