BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
MadQuant
Obsidian | Level 7

Ah, this is it! 

Now I should change my question.

How do I assign the 4000-ish SYM_ROOTs dynamically into, say, 40 equal macro variables to use it in WHERE clause?

 

So instead of using 

 

where SYM_ROOT=:'A'

where SYM_ROOT=:'B'

etc

 

which would vary in size, I would like to have equal subset of SYM_ROOT to put it in the WHERE clause of my main analysis code. Each day would be different, so it has to depend on the total number of obs of SYM_ROOT on daily bases.

 

I searched a few postings but mostly they rely on additional group identifiers. In my case there aren't any.

Reeza
Super User

Take the total number of obs, from sashelp.vtable, divide it by 40 and split your dataset into your 40 subsets by the number of records. 

If you need to keep the groups together, then consider seeing if you can tweak a PROC SURVEYSELECT to do it for you.

MadQuant
Obsidian | Level 7
Thanks. I wasn't aware of PROC SURVEYSELECT, but I will look into it.

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!

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.

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
  • 17 replies
  • 4119 views
  • 12 likes
  • 6 in conversation