LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2001, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 20 Mar 2001 14:03:46 -0500
Reply-To:     "Ravi, Prasad" <Prasad.Ravi@PFIZER.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Ravi, Prasad" <Prasad.Ravi@PFIZER.COM>
Subject:      Re: concatenation get warning in sql, but not is data step,
              any w ay t o supress it?
Content-Type: text/plain; charset="iso-8859-1"

That is smartness, isn't it???? Well try that put function with $200. instead of $20. see what happens.

What was the purpose of defining these variables length first to 200 characters then reduce it to 20.

-----Original Message----- From: Huang, Ya [mailto:ya.huang@AGOURON.COM] Sent: Tuesday, March 20, 2001 1:44 PM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: concatenation get warning in sql, but not is data step, any w ay t o supress it?

Never mind, I've found a workaround:

proc sql; select put(a,$20.)||put(b,$20.)||put(c,$20.) as e from xx ;

It is interesting that put() behaves different than putc() in the sense putc() keep the old length, while put() give you a new length.

-----Original Message----- From: Ravi, Prasad [ mailto:Prasad.Ravi@PFIZER.COM <mailto:Prasad.Ravi@PFIZER.COM> ] Sent: Tuesday, March 20, 2001 10:03 AM To: SAS-L@LISTSERV.UGA.EDU Subject: Re: concatenation get warning in sql, but not is data step, any w ay t o supress it?

In Proc SQL, character functions which return a value of length of 200 in a SELECT statement will generate the following message:

Warning: Concatenated strings can be at most 200 characters.

These functions include COLLATE, COMPRESS, LEFT, REPEAT, REVERSE and SCAN.

The warning is designed only to alert the customer that if the returned string was to exceed 200 characters, truncation would occur.

-----Original Message----- From: Huang, Ya [ mailto:ya.huang@AGOURON.COM <mailto:ya.huang@AGOURON.COM> ] Sent: Tuesday, March 20, 2001 12:39 PM To: SAS-L@LISTSERV.UGA.EDU Subject: concatenation get warning in sql, but not is data step, any way t o

supress it?

Hi there,

Obviously, it is for SAS 6.12:

See the following code, the concatenation operation in data step is OK, but get warning in sql. I tried to use putc() to limit the strings lenght on fly (can I?), but still get the warning. Each string in the concatenation is much less 200 in length, and they will NOT add up more than 200.

Any way to suppress the warning?

1 data xx; 2 length a b c $ 200; 3 a='abc'; 4 b='def'; 5 c='ghi'; 6 d=trim(a)||trim(b)||trim(c); 7 put a b c d; 8

abc def ghi abcdefghi NOTE: The data set WORK.XX has 1 observations and 4 variables. NOTE: Compressing data set WORK.XX decreased size by 0.00 percent. Compressed is 1 pages; un-compressed would require 1 pages.

9 proc sql; 10 select trim(a)||trim(b)||trim(c) as e 11 from xx 12 ; WARNING: Concatenated strings can be at most 200 characters. NOTE: The PROCEDURE SQL printed page 1.

Thanks a lot.

Ya Huang


Back to: Top of message | Previous page | Main SAS-L page