BookmarkSubscribeRSS Feed
K_Taylor
Calcite | Level 5

I am trying to merge the datasets from the NHIS sample adult and person files from years 2006 to 2018. I am able to merge within the years without any problem, however, when I attempt to merge across years, SAS provides a long list of format errors - for example:

 

Capture.JPG

The error list goes on and on since there are so many variables in the datasets with associated formats.

 

 

The formats for each year are all stored as permanent format files. And I've tried to use the below statement, without luck.

 

options fmtsearch=(fmtlib);

data out.comboNHIS;
set tomerge2006 tomerge2007 tomerge2008 tomerge2009 tomerge2010 
tomerge2011 tomerge2012 tomerge2013 tomerge2014 tomerge2015
tomerge2016 tomerge2017 tomerge2018;
run;

 

Is there anyway to embed each of the formats within each of the individual datasets when importing them so that I won't run into this issue? Any other easy solution to this?

 

Using v.9.4.

2 REPLIES 2
Astounding
PROC Star

You will need the formats eventually.  But if you just want to be able to skip the error messages temporarily, you can issue this as the first statement in the program:

 

options nofmterr;

 

It eliminates the error message when a format cannot be found.

Reeza
Super User
I thought those data sets came with the format files. Did you run that program specifically? Did it error out for some reason?

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
  • 734 views
  • 3 likes
  • 3 in conversation