Creating All Possible Combinations in a Table Using SAS

前端 未结 3 1460
一生所求
一生所求 2020-12-11 09:16

I have a table with four variables and i want the table a table with combination of all values. Showing a table with only 2 columns as an example.

NAME    AM         


        
3条回答
  •  星月不相逢
    2020-12-11 10:01

    Try

    PROC SQL;
    CREATE TABLE tbl_out AS
    SELECT a.name AS name 
           ,b.amount AS amount
           ,c.count AS count
    FROM tbl_in AS a, tbl_in AS b, tbl_in AS c
    ;
    QUIT;
    

    This performs a double self-join and should have the desired effect.

提交回复
热议问题