BookmarkSubscribeRSS Feed
Calcite | Level 5



I am doing a research project examining the association between Vitamin A intake and CVD in Hispanic women.


I am using 5 datasets: demographics, smoking, medical conditions, total dietary intake, and body measures. I want to merge these data sets. However, the total dietary intake dataset would need to transform the detailed file into a person-level file (with one record for each person) before merging it with NHANES demographic and other data files by using  seqn as the unique identifier.


How can I do this in SAS? I have attached the total dietary intake dataset for reference. Thanks!

Super User

I didn't read every single one of 10,000 plus lines but I did not see any duplicates of SEQN until the bottom of the file where apparently something other than data appears in the last 5 or 6 lines. So you need to describe what is keeping you from merging the file.


I'm not going to read the entire documentation on the NHANES website to determine what any of that data represents or the problems involved. I would recommend searching the site carefully as I doubt that you are the first person to attempt such and there is likely to be example code there. Just may take some digging.



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

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.

Get the $99 certification deal.jpg



Back in the Classroom!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 2 in conversation