Date: Fri, 1 Sep 2006 01:24:03 -0700
Reply-To: Dubro <dubro@DOLIC.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dubro <dubro@DOLIC.DE>
Organization: http://groups.google.com
Subject: Re: How to remove leading blanks from macro variables
In-Reply-To: <1157098623.712723.265880@i42g2000cwa.googlegroups.com>
Content-Type: text/plain; charset="iso-8859-1"
Hi Rune,
try either trim() in your proc sql statement or use $let
num_sd_dok_bads_may_be_OK_1 = num_sd_dok_bads_may_be_OK_1;
HTH
Rune Runnestø schrieb:
> How do I remove leading blanks from macro variable values ?
>
> Here is a snippet of code demonstrating the issue:
>
> proc sql noprint;
> select count(*) into :num_sd_dok_bads_may_be_OK_1
> from &lib..tp33_sd_dok_badrecs_may_be_OK_1;
>
> select count(*) into :num_sd_dok_bads_not_OK_1
> from &lib..tp33_sd_dok_badrecs_not_OK_1;
> quit;
>
>
> %put &num_sd_dok_bads_may_be_OK_1;
> %put &num_sd_dok_bads_not_OK_1;
>
>
> >From the log:
>
> SYMBOLGEN: Macro variable NUM_SD_DOK_BADS_MAY_BE_OK_1 resolves to
> 1
>
> SYMBOLGEN: Macro variable NUM_SD_DOK_BADS_NOT_OK_1 resolves to
> 1
>
> As we see, the macro variables have leading blanks. This is
> inconveniente
> when using them in text strings. How do I get rid of leading blanks in
> macro variables ?
>
> Regards,
> Rune
|