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

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

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
  • 2 replies
  • 966 views
  • 0 likes
  • 2 in conversation