Here is all my code:
ODS LISTING;
libname session1 "x";
PROC IMPORT OUT= WORK.one
DATAFILE="x"
DBMS=csv REPLACE;
RUN;
proc print data= WORK.one;
run;
proc contents;
run;
data WORK.one;
set WORK.one;
pce0 = PCE/78.23517;
rpgas = Price/pce0;
run;
I get these error messages in my log after I run my last code and I have no idea why:
NOTE: Variable pce is uninitialized.
NOTE: Variable price is uninitialized.
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
1 at 136:11 1 at 137:14
NOTE: The data set WORK.DATA4 has 1 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 0.07 seconds
cpu time 0.01 seconds
139 pce0 = pce/78.23517;
----
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
140 rpgas = price/pce0;
-----
180
ERROR 180-322: Statement is not valid or it is used out of proper order.
141 run;
142 data WORK.one;
143 pce0 = pce/78.23517;
144 rpgas = price/pce0;
145 run;
NOTE: Variable pce is uninitialized.
NOTE: Variable price is uninitialized.
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
1 at 143:11 1 at 144:14
NOTE: The data set WORK.ONE has 1 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 1.24 seconds
cpu time 0.12 seconds
146 data WORK.one;
147 set WORK.one;
148 pce0 = pce/78.23517;
149 rpgas = price/pce0;
150 run;
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
1 at 148:11 1 at 149:14
NOTE: There were 1 observations read from the data set WORK.ONE.
NOTE: The data set WORK.ONE has 1 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 0.12 seconds
cpu time 0.03 seconds
151 data WORK.one;
152 set WORK.one;
153 pce0 = PCE/78.23517;
154 rpgas = Price/pce0;
155 run;
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
1 at 153:11 1 at 154:14
NOTE: There were 1 observations read from the data set WORK.ONE.
NOTE: The data set WORK.ONE has 1 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds
Thanks!
Please help us out by making the log easier to read.
Step 1. Click on the {i} icon
Step 2. Paste the entire log (not just the error messages) into that window.
This looks like part of the code where you suspect the issue is, can you also post the whole log, with mprint source and mlogic.
The part code you posted is working fine.
I am asuming you have posted correct path in place of "x" in libname and filenames.
Save the log to a text file if it is large and attach to your question,
or you can post it using the {i} in the replay editor tool bar, Like this and paste the whole log like this
Where is the code that created WORK.DATA4?
@khalillx wrote:
NOTE: Variable pce is uninitialized.
NOTE: Variable price is uninitialized.
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
1 at 136:11 1 at 137:14
NOTE: The data set WORK.DATA4 has 1 observations and 4 variables.
NOTE: DATA statement used (Total process time):
real time 0.07 seconds
cpu time 0.01 seconds
While you have posted pieces of different logs here, the answer to your question lies here:
Why did you run PROC PRINT and PROC CONTENTS and never examine the results?
It would show you that the variables PCE and PRICE were not imported from the spreadsheet. Start there.
Looking at your log.docx file, I think the problem is that you have the .csv file open in Microsoft Excel. For some reason Excel monopolizes the files it reads, you are not even allowed to read them. If you close the file in Excel and try Again, it may help.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.