Date: Thu, 12 Aug 2004 08:12:09 -0700
Reply-To: "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Choate, Paul@DDS" <pchoate@DDS.CA.GOV>
Subject: OT: Is SAS growing Linearly or Exponentially?
Hi Howard -
Hadn't seen the CAT functions yet, thanks for the tip.
<rant>
I count 473 functions and call routines in v9, up from 135 functions and
call routines in my v5 manual. That's around 113 new functions with each
new version, not counting the short lived v7. Now, v8 was released in 1999
and v9 in 2004, and so that makes about one new function every two weeks.
So, to keep up with just the functions, a SAS programmer needs to learn
about one new function every two weeks. Given the frequency that I see a
new function like this on SAS-L, I'd say this is pretty close! Then there
are all the new statements (some like ODS not so trivial at all), formats,
informats, system options, dataset options, new procedures (I'm still trying
to adapt to SQL, fourteen years later!), the whole macro language, not to
mention complete suites of products like enterprise guide, the new business
server and the old JMP software. Have I missed anything? I don't know how
anyone comes close to keeping up with it. How do new users feel when they
dig around the onlinedoc for the first time? I can sure see the appeal of
the Little SAS Book primer.
</rant>
Paul Choate
DDS Data Extraction
(916) 654-2160
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Howard
Schreier
Sent: Wednesday, August 11, 2004 7:43 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Re: Format adds space
Because you have no embedded blanks in your INDICn values, using COMPRESS
rather than COMPBL will give you a quick fix.
More generally, the appropriate practice is to apply the TRIM function to
any operand on the left side of the concatentation operator.
indic = trim(indic1) || trim(indic2) || . . .
In Version 9, the CATX function and its siblings make this sort of task
much easier and neater (you can easily lose that leading hyphen, which you
probably don't want).
It's hard to be sure without seeing all of the code, but your INDICn
variables probably have "exact" lengths. Code like
charvar = trim(charvar)
The *stored* length of a character variable cannot vary from observation to
observation.
accomplishes nothing, because the result will be padded right back to its
original length when it is stored back into the variable.
Your ELSE statements probably don't do anything either (again, one can't be
sure without seeing the code).
On Wed, 11 Aug 2004 10:04:40 -0500, Herbert Morley A
<Morley.Herbert@LONESTARHEALTH.COM> wrote:
>OK experts. I'm at a loss
>
>I have imported data from an Excel spreadsheet. Various columns have yes/no
>for whether treament was applied to a specific body part eg: hands, feet,
>face etc.
>
>I want to create a variable 'indic' which shows all the areas marked yes.
If
>hands are yes and feet are yes then it should have the value "Hands-Feet".
>There are 5 possible areas for treament and a large number of possible
>combos.
>
>I use a dash to separate the terms so it is readable.
>
>Here is my code.
>
>IF hands = "Yes" THEN indic1= "-Hands"; ELSE indic1 = "";
>IF feet = "Yes" THEN indic2 = "-Feet"; ELSE indic2 = "";
>IF underarms = "Yes" THEN indic3 = "-Axilla"; ELSE indic3 = "";
>IF face = "Yes" THEN indic4 = "-Face"; ELSE indic4 = "";
>IF blushing = "Yes" THEN indic5 = "-Blush"; ELSE indic5 = "";
>
>* Now concatenate the applicable values;
>indic = COMPBL(indic1||indic2||indic3||indic4||indic5);
>
>The PROBLEM (at least for me)
>Sometimes it works perfectly
>-Hands-Feet-Axilla-Face-Blush
>
>Sometimes there are spaces in the line
>-Hands -Axilla-Face (one space between hands and axilla)
>
>It seems to be when a variable is length 0 (missing).
>
>I have tried
> using Length statements to define each indic1-5 as its exact length
> using TRIM with each indic1-5
> not using the ELSE statements.
>It all comes out the same. The program works OK, but I am curious abour
what
>I am missing in the formatting area.
>
>Thanks
>Morley Herbert
>Medical City Dallas Hospital