So, I am trying to analyse a subset of YRBSs data 2017, I successfully keep the variables I am interested in but under the SAS log i get notes saying ' format could not be found or successfully loaded for the variables of interest. I feel this might affect me moving forward and I want to know if anyone has experience with this dataset or can help me solve this.
libname DMZ '/folders/myshortcuts/MyFolders/NEW17';
run;
/* Study Variables dataset*/
data DMZ.dmprev;
set DMZ.NEW17 (keep=raceeth qnowt qnobese Q1 Q2 Q30 Q71 Q72 Q74 Q75 Q76 Q79);
run;
SAS LOG
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 data DMZ.dmprev;
74 set DMZ.NEW17 (keep=raceeth qnowt qnobese Q1 Q2 Q30 Q71 Q72 Q74 Q75 Q76 Q79);
75 run;
NOTE: Format $H1S was not found or could not be loaded.
NOTE: Format $H2S was not found or could not be loaded.
NOTE: Format $H30S was not found or could not be loaded.
NOTE: Format $H71S was not found or could not be loaded.
NOTE: Format $H72S was not found or could not be loaded.
NOTE: Format $H74S was not found or could not be loaded.
NOTE: Format $H75S was not found or could not be loaded.
NOTE: Format $H76S was not found or could not be loaded.
NOTE: Format $H79S was not found or could not be loaded.
NOTE: Format $HRCE was not found or could not be loaded.
NOTE: There were 14765 observations read from the data set DMZ.NEW17.
NOTE: The data set DMZ.DMPREV has 14765 observations and 12 variables.
NOTE: DATA statement used (Total process time):
real time 0.46 seconds
cpu time 0.22 seconds
Alternative way is removing all these formats in table.
data air;
set sashelp.air;
run;
proc datasets library=work nolist nodetails;
modify air;
attrib _all_ format= ;
quit;
@mjawla wrote:
So, I am trying to analyse a subset of YRBSs data 2017, I successfully keep the variables I am interested in but under the SAS log i get notes saying ' format could not be found or successfully loaded for the variables of interest. I feel this might affect me moving forward and I want to know if anyone has experience with this dataset or can help me solve this.
You are also missing things to do proper analysis of YRBSS data. The survey is a complex sample design I don't see any of the weighting, cluster or strata variables(if strata are used by the state your data is from).
The proper analysis procedures are going to be the survey procedures such as Surveymeans, surveyfreq, surveylogistic and such.
I suggest looking at the source of your data file and see if there were any SAS program files with the format codes and/or assignment statements.
The weighting and sample design variables should be in the data sets.
You would have to reference them. Typically the CDC websites have some example analysis code you should be able to crib from regarding the survey proc syntax and the sample design elements needed.
https://www.cdc.gov/healthyyouth/data/yrbs/pdf/2017/2017_YRBS_analysis_software.pdf
has some example code for analysis using different software packages including SAS with an example using SURVEYFREQ. The other survey procs would use the same Weight, Strata and Cluster statements assuming your data has those variables.
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.