Hey,
When I run this program from the Programming 1: Essentials I get the following error:
"ERROR: File WORK.CALSS.DATA does not exist"
data myclass; set sashelp.class; run; proc print data=class; run
The code you show will not throw the error you claim.
Since your Proc Print code Run statement does not show an ending semicolon it will not execute until some other code is submitted at which point it would throw an error more like:
ERROR: Unrecognized form of the RUN statement. Use either RUN; or RUN CANCEL;.
Assuming your code actually has the semicolon and you just didn't copy it then your LOG should look something like:
1145 data myclass; 1146 set sashelp.class; 1147 run; NOTE: There were 19 observations read from the data set SASHELP.CLASS. NOTE: The data set WORK.MYCLASS has 19 observations and 5 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 1148 1149 proc print data=calss; ERROR: File WORK.CALSS.DATA does not exist. 1150 run; NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE PRINT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds
where you create WORK.MYCLASS then misspell "class" as "calss" and completely forget the "my" part of the set you created. Even if you use "mycalss" it would fail as spelling counts in programming. Case of letters in general for data set or variable names would not affect SAS code but the actual letters supplied does.
@davidjayjackson wrote:
Hey,
When I run this program from the Programming 1: Essentials I get the following error:
"ERROR: File WORK.CALSS.DATA does not exist"
data myclass; set sashelp.class; run; proc print data=class; run
Thanks for your reply.
Here is the link for the instructions for this exercise. I went back and checked and I didn't see a proc print.
https://learn.sas.com/pluginfile.php/13144/mod_scormddl/content/605092/01/epg1v201_2_p_l1.htm
Thanks again.
David
The code you posted is nowhere to be found on the page you linked.
The solution for the code you posted is given by @Ksharp.
To avoid misunderstandings, do NOT type logs into a post. Copy/paste the log as is, including the log line numbers, into a code box, just as you did with the code.
Also avoid using tabs in code, have them replaced with blanks by the editor; different environments use different tab sizes, causing your code to look funny.
@davidjayjackson wrote:
Hey,
When I run this program from the Programming 1: Essentials I get the following error:
"ERROR: File WORK.CALSS.DATA does not exist"
data myclass; set sashelp.class; run; proc print data=class; run
The code you have posted won't write the mentioned error message to the log.
The data step creates the dataset "myclass", the following proc print tries to use the dataset "class" which doesn't exist. @Ksharp has already given the solution for the problem.
The code you show will not throw the error you claim.
Since your Proc Print code Run statement does not show an ending semicolon it will not execute until some other code is submitted at which point it would throw an error more like:
ERROR: Unrecognized form of the RUN statement. Use either RUN; or RUN CANCEL;.
Assuming your code actually has the semicolon and you just didn't copy it then your LOG should look something like:
1145 data myclass; 1146 set sashelp.class; 1147 run; NOTE: There were 19 observations read from the data set SASHELP.CLASS. NOTE: The data set WORK.MYCLASS has 19 observations and 5 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds cpu time 0.00 seconds 1148 1149 proc print data=calss; ERROR: File WORK.CALSS.DATA does not exist. 1150 run; NOTE: The SAS System stopped processing this step because of errors. NOTE: PROCEDURE PRINT used (Total process time): real time 0.00 seconds cpu time 0.00 seconds
where you create WORK.MYCLASS then misspell "class" as "calss" and completely forget the "my" part of the set you created. Even if you use "mycalss" it would fail as spelling counts in programming. Case of letters in general for data set or variable names would not affect SAS code but the actual letters supplied does.
@davidjayjackson wrote:
Hey,
When I run this program from the Programming 1: Essentials I get the following error:
"ERROR: File WORK.CALSS.DATA does not exist"
data myclass; set sashelp.class; run; proc print data=class; run
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.