BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mjawla
Fluorite | Level 6

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
       
1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star
This means that your data contains codes, not text that can be easily interpreted. You can work with the codes easily enough by making this the first statement in the program:

options nofmterr;

But the best solution is to find the formats. First look in the folder identified as DMZ. If you see a catalog there named formats, add after the libname statement:

options fmtsearch=(work.formats, dmz.formats) ;

If that's not it, you first need to find the catalog holding the formats.

View solution in original post

6 REPLIES 6
Astounding
PROC Star
This means that your data contains codes, not text that can be easily interpreted. You can work with the codes easily enough by making this the first statement in the program:

options nofmterr;

But the best solution is to find the formats. First look in the folder identified as DMZ. If you see a catalog there named formats, add after the libname statement:

options fmtsearch=(work.formats, dmz.formats) ;

If that's not it, you first need to find the catalog holding the formats.
mjawla
Fluorite | Level 6
Thank you, using
options fmtsearch=(work.formats, dmz.formats) ;
sorted it out.
Ksharp
Super User

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;
ballardw
Super User

@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.

mjawla
Fluorite | Level 6
I downloaded the SAS files straight from the CDC database, and did the steps needed to create the data in the steps they highlighted. Does surveymeans, freq and logistics inculcate the weighing and strata of the variables or do i have to do that by itself usng other steps?
ballardw
Super User

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-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!

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
  • 6 replies
  • 743 views
  • 3 likes
  • 4 in conversation