BookmarkSubscribeRSS Feed
phara30
Calcite | Level 5

hello i have a code which when I running, it  doesn't work. I cannot troubleshoot the errors.

proc freq data=temp;
table type_weather;
run;
data =temp;
set temperature;
if type_weather <= 3 then precipitation ='dry';
else precipitation = 'wet' ;
run;

proc print data=temp;
var precipitation type_weather;
run;
proc freq data=temp;
tables modiness * type_weather / expected chisq;
run;

 

3 REPLIES 3
Reeza
Super User
Look at the log and go through them one by one. I'm guessing your first one is at data=temp? That's becaue there should not be an equal sign there. Post your log and code if you need further help.

Also, if you're creating temp in step 2, how is it available for the previous step - the PROC FREQ? The temp data set has not been creating at this point in time.
ballardw
Super User

Doesn't work is awful vague.

Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.

No output? Post any log in a code box.

Unexpected output? Provide input data in the form of data step code pasted into a code box, the actual results and the expected results. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

Alobaidi
Calcite | Level 5

The error in the forth line which is

 

data =temp;

 

just remove the  (=) sign

it will be  data temp;  

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1034 views
  • 0 likes
  • 4 in conversation