Edit

SAS: PROC SQL (Select... From)

2016/12/18
  This is a simple example of 'Select - From' clause on 'Proc SQL.'  With using this clause, you can define some variable(s) for a new table (dataset) and can identify which table will be referred as the source.  The following example is a program to create new table of 'DEMOG1' with keeping all current variables to use '*' in 'DOMOG' (LINK) and with adding a new variable of 'RES_100.'  In this clause, you can define label and format.  

And 'Create Table' clause can define new table, and this is similar to 'Data Statement' for 'Data step.'


PROGRAM 
--------------------------------------
/* NEW TABLE   : DEMOG1
   SOURCE TABLE: DEMOG
   VARIABLE    : ALL in DEMOG to use '*' and 
                 A new of 'WT_LBS'
*/
PROC SQL ;
 CREATE TABLE DOMOG1
 AS SELECT 
   * ,  
   WT/0.45359237 AS WT_LBS LABEL='WEIGHT(Pound)' FORMAT =10.1    
 
FROM DEMOG;
QUIT ;
--------------------------------------  

OUTPUT (NOT FULL DATA)


Search This Blog