BookmarkSubscribeRSS Feed
weo
Calcite | Level 5 weo
Calcite | Level 5

 

want to ask about proc surveyfreq analysis

i can't solve this problem and need a help

 

age 30 is column for test

'data usee; set usee;if 30 <= age then age30=1; else age30=0; run;'

use this code 

 

ff_use is real for analysis

'data use; set use; if age_all='.' or check ='.' or he_wt=. or he_ht=. then ff_use = 0; run;
data use; set use; if ff_use=. then ff_use=1;run;'

take from multiple Variables

 

 

really cant find what wrong in my data...

column attribution also same , type, format..all same

how can i make table ff_use '0'

 

 

2 REPLIES 2
sbxkoenk
SAS Super FREQ

Hello,

 

Like many others on these communities I do not like to download files.

It's always better to share (part of) your data using SAS code (a data step with input statement and datalines;).

 

But OK.

Qua syntax there's nothing wrong with your code, but do age_all and check really have the values '.' (a single dot)?

If you want to check whether age_all and check have a missing value you should use '' (2 adjacent single quotes) or use the missing function.

 

Thanks,

Koen

ballardw
Super User

1) do not see any surveyfreq code so not sure what the question is about surveyfreq.

2) If you use this type of code often: data usee; set usee; then you are completely replacing the Usee data set every time it executes without a syntax error. Which means that data manipulation logic problems

3) your second set of code is using a different data set: data use; set use;

   So which data set did you use for analysis?

4) You ask : how can i make table ff_use '0'. What table?

 

I strongly suggest that you share the LOG from running your code. The Log often shows details that are important for diagnosing things. Run your code, copy the log with all the code and messages then on the forum open a text box using the </> icon that appears above the message window and paste the text. The text box is important to maintain text formatting as the message windows on this forum will reformat text.

 

There really is no reason to provide 2 Mbyte files for examples. Better is to provide data step code that generates data sets because I get language character conversion issues.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 2 replies
  • 298 views
  • 0 likes
  • 3 in conversation