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

Thanks Quinn; I am being told that 12 is the maximum.  However, what if one didn`t know the max?

mstergia
Calcite | Level 5
Thanks Quinn - that was exactly the problem. What if one didn`t know the array upbound. Is there a way to write the code when you don`t know what that # is?
Quinn
Fluorite | Level 6

1. use COUNTC() function.

2. use the variable prefix as the array name.

Hope it helps.

L.L.

 

proc sql;

select max(countc(TrainingTopic,';'))+1  into: max_ct from ...;

quit;

 

data ... ;

...

array Topic(&max_ct) $100 ;

...

 

 

 

 

mstergia
Calcite | Level 5

Wondering, what does the * do rather than putting the max # of observations in the () in :  array parsed_vars(*) new_var1-new_var6;

 

Trying to understand the diff between putting parsed_vars(*) vs. parsed_vars(6)?

 

Also, what if you didn`t know the max # of observations?  what would you do in that case if you only wanted the first 6?

 

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!

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
  • 18 replies
  • 89488 views
  • 12 likes
  • 9 in conversation