BookmarkSubscribeRSS Feed
khalillx
Fluorite | Level 6

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!

 

11 REPLIES 11
PaigeMiller
Diamond | Level 26

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.

--
Paige Miller
Satish_Parida
Lapis Lazuli | Level 10
Could you also send the data along. If not possible mask the data.
Satish_Parida
Lapis Lazuli | Level 10

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.

Satish_Parida
Lapis Lazuli | Level 10

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
Satish_Parida
Lapis Lazuli | Level 10
The issue looks like in the import statement.
1. Can you close the CSV file if opened in EXCEL or any other text editor.
2. If the issue still not resolved, could you tell if you are writing the ODS output to any source?
Kurt_Bremser
Super User

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

 

Astounding
PROC Star

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.

s_lassen
Meteorite | Level 14

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.

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 11 replies
  • 1571 views
  • 0 likes
  • 6 in conversation