BookmarkSubscribeRSS Feed
brm
Calcite | Level 5 brm
Calcite | Level 5
I'm trying to store all distinct records in a macro variable.

Proc sql noprint ;
select distinct DRC_CASE_ID into : tempids separated by ',' from c;
quit;

Getting below error,how can i do it using sas

15 Proc sql;
16 select distinct DRC_CASE_ID into : tempids separated by ',' from c;
ERROR: The length of the value of the macro variable TEMPIDS (79271) exceeds the maximum length
(65534). The value has been truncated to 65534 characters.
17 quit;
1 REPLY 1
Patrick
Opal | Level 21
Hi

You hit the maximum storage capacity of macro variables in a 64bit environment.

You will have to use another technique to achieve what you're after (i.e. a join or a hash look-up).

HTH
Patrick

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

Register now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 1 reply
  • 1058 views
  • 0 likes
  • 2 in conversation