BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have three data sets. Each one of them is very lengthy! So I need help in finding shortcuts on how to process the data sets.

1) I noticed that the length of some variables is unreasonably long so how do I shorten the length of those variables? I tried doing this, but it didn't work for me:
DATA A;
LENGTH MTOTAL $ 8;
SET TOT.TOTAL1;
RUN;

2) Each data set have countless participants that made visits. Each participant is supposed to have 32 observations per visit. How do I make sure there are exactly 32 observations per participant at each visit? I did PROC REPORT for each data set and tried counting 32 observations for each participant but that proved to be time consuming. What's the shortcut to do this?
2 REPLIES 2
LinusH
Tourmaline | Level 20
1) What do you mean that this doesn't work? I got a clean $8 char for MTOTAL in the A table.

2) Depends on how you want the output, and what time consuming means.
One way is to use SQL, with COUNT(), GROUP BY and HAVING to filter out visits with less than 32 observations.

/Linus
Data never sleeps
deleted_user
Not applicable
I tried proq sql count(). it worked. thanks!!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1523 views
  • 0 likes
  • 2 in conversation