BookmarkSubscribeRSS Feed
HeatherNewton
Quartz | Level 8
Proc SQL;
    create  table acct_list_cen_limit_2A as 
    select org_code, account_no, LOGO, card_type, relationship_no,
    date_Credit_limit_chg as Date_Credit_limit_chg,
    ratio,
    p_credit_limit*Ratio as p_credit_limit,
    IND_CENTRAL_LIMIT,
    FIRST_DEFAILT,
    SAMP_OS,
    SAMP_CRLIM*RATIO as SAMP_CRLIM,
    PBI_BALANCE as PBI_BALANCE,
    DEFAULT_AMT AS DEFAULT_AMT,
    SAMP_CRLIM_ALL*RATIO AS SAMP_CRLIM_ALL,
    MONTH_DEF AS MONTH_DEF,
    PORTFOLIO AS PORTFOLIO,
    REL_CNT AS REL_CNT
FROM ACCT_LIST_CEN_LIMIT_2;
QUIT;

    

Why are some variables being renamed to the same name? what does this mean?

2 REPLIES 2
LinusH
Tourmaline | Level 20

In the way it appears here, it's optional.

So it's pretty much up to the developer to decide the programming style.

Data never sleeps
Tom
Super User Tom
Super User

Why the coder decided to use "date_Credit_limit_chg as Date_Credit_limit_chg" instead of just "date_Credit_limit_chg" you would need to ask the coder directly.

 

Note that there are no aliases being used in that code.  In SQL jargon the ALIAS is the short name assign to an input dataset so you have it as a prefix when referencing a variable to make sure that SQL knows which source dataset the variable should come from.

 

If this example A and B are the aliases:

proc sql;
create table want as
  select a.name,b.address
  from names a
  left join address b 
  on a.name=b.name
;
quit;

 

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 690 views
  • 0 likes
  • 3 in conversation