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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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