Date: Wed, 12 Dec 2007 11:05:25 -0600
Reply-To: bruce johnson <chimanbj@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: bruce johnson <chimanbj@GMAIL.COM>
Subject: Re: rename variable name in SQL
In-Reply-To: <d4c45352-b636-483d-8a68-3a8aa5747be5@18g2000hsf.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Could you just edit the code to give that 5th field a name and re-run
the SQL code?
On Dec 12, 2007 10:53 AM, shaunak.adgaonkar@gmail.com
<shaunak.adgaonkar@gmail.com> wrote:
> Guys,
> I have used a code in proc sql and it generated the new table with
> column name as a number now i want to rename it but i am not able to
> do it . The code is as follows
>
> create table mylib.licb as
> SELECT
> AMOUNT,
> COMPANY,
> ACCOUNT,
> PRODCDE,
> CASE
> WHEN ACCOUNT IN ('424300', '424100', '424150') AND PS_PRODCODE IN
> ('PERMX', 'TERMX') THEN 'A. Life Insurance:'
> WHEN ACCOUNT IN ('424000') AND PRODCODE IN('PERMX', 'TERMX') THEN 'B.
> Life Insurance:'
>
> FROM
> FIN_MGT
> ));
>
>
> LICB is created as
>
> AMOUNT Company Account Prodcode 5
> 100 ABC 424300 PERMX A. Life Insurance
> 200 DEF 424000 TERMX B.Life Insurance
>
>
> Now i am wondering how to rename this variable named 5. Have tried
> proc sql alter table and other options also but was not able to change
> it because the name itself is a number. Does anyone have experienced
> same situation prior, any help appreciated
>
|