Date: Fri, 24 Oct 2008 14:17:36 -0400
Reply-To: Dave Scocca <dave@SCOCCA.ORG>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Dave Scocca <dave@SCOCCA.ORG>
Subject: Re: COMPRESS function modifier not working as expected in PROC SQL
In-Reply-To: <456B52C41B724C41B96561D7AD283E7DEFE8E0@mail.chpdm.umbc.edu>
Content-Type: text/plain; charset=us-ascii; format=flowed
--On 10/24/2008 2:12 PM -0400 Jack Clark wrote:
> When I run it in PROC SQL, an ERROR is generated.
> 754
>
> 755 proc sql;
>
> 756 select compress(x,,"d") as y
>
> -
>
> 22
>
> ERROR 22-322: Syntax error, expecting one of the following: a name, a
> quoted string,
>
> a numeric constant, a datetime constant, a missing value,
> BTRIM, INPUT, LOWER, PUT,
>
> SUBSTRING, UPPER, USER.
It looks like the DATA step allows two consecutive commas to represent a
missing parameter, while SQL requires an explicit specification of the
missing parameter between the commas (as . or ""). The following should
work:
proc sql;
select compress(x,"","d") as y
from test
;
quit;
Dave Scocca
|