BookmarkSubscribeRSS Feed
data_null__
Jade | Level 19

The BY statement variable directives can be used in many places other than TITLE statement where they were first introduced.

I wrote some code (some sort of macro thing) where a variable can contain #byval(variable) and I replace that with the BY value using VVALUEX, and TRANSTRN etc.   Of course I could have used another syntax but I don't like to invent my own, where there exists a perfectly good one.

Seems like there should be a way to use what has already been done by SAS to support this kind of replacement,  I was thinking a function might exist but did not find one.

2 REPLIES 2
Astounding
PROC Star

I'm not as familiar with this as I should be, but ...

I would imagine that ODS templates can take care of this.

Cynthia_sas
SAS Super FREQ

Hi:

ODS DOCUMENT has some automatic variables and I know that TAGSETS.EXCELXP has implemented some BY group support for #BYVAL/#BYVAR/#BYLINE, but as far as I know, it is only documented here in the TITLE statement: SAS(R) 9.4 Statements: Reference, Second Edition -- so your approach of using VVALUEX, etc might be the most flexible.

cynthia

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