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?
In the way it appears here, it's optional.
So it's pretty much up to the developer to decide the programming style.
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;
Calling all data scientists and open-source enthusiasts! Want to solve real problems that impact your company or the world? Register to hack by August 31st!
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.
Ready to level-up your skills? Choose your own adventure.