Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LEFT function in SAS-SQL creates a warning, but it's plain SQL

Status
Not open for further replies.

wphupkes

Technical User
Jul 1, 2008
22
NL
Hi,

I've created a (SAS) SQL query, but this generate a warning ("Function LEFT requires at most 1 argument(s). The extra one(s) will be ignored."). In Management Studio the query (this part) works great, but not in SAS. Can anyone see the problem?

The 'faulty' part:

WHEN LEFT(MAX(Addr.ZipCode),3) IN ('101', '102') OR MAX(Addr.ProvinceName) IN ('Berlin', 'Brandenburg') THEN 'E'
WHEN MAX(Addr.ProvinceName) IN ('Baden', 'Hamburg') THEN 'W' END AS RM_EW

Thanks for your answer!!
 
Left in SAS is merely an alignment thing. You are telling it to left align whatever variable.

I think you are looking for the Substr function.

SUBSTR(MAX(Addr.ZipCode),1,3) IN ('101','102')

Not sure what you are trying to achieve with the Max function on a character, but I guess that's another subject entirely.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top