Date: Tue, 19 Nov 2002 17:40:57 -0500
Reply-To: "Karl K." <karlstudboy@HOTMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Karl K." <karlstudboy@HOTMAIL.COM>
Subject: Re: proc report width=
On Tue, 19 Nov 2002 17:29:23 -0500, Kevin Auslander
<kauslander@TERRECRS.COM> wrote (in part):
>Is there
>anyway to access the length of the longest word in each label in the
>data step? I guess I could use proc contents. But that would require
>many more steps. It seems like there should be a simpler way of doing
>this.
I don't know if this counts as "simpler", but you could:
1. select the labels from the relevant variables from the columns
dictionary table into a macro variable (separated by space), then,
2) nest the scan() function inside the length() function, and
3) iterate over the total number of words in all the labels, keeping the
max length as you go, then
4) SYMPUTting the final max length into a macro variable to give to PROC
REPORT
The varlabel() function would be an alternative to step 1 if you can't
afford a step boundary to read the dictionary table.
Just my 2 cents.
Karl
|