Great question Arne. So in this example I'm showing to how to create a column for ad hoc analysis for any action. However, to create a new table and promote it using the new columns you will have to use the table.copyTable action (if you are using Viya 3.5 you will have to use the table.partition action in the same way). The copyTable action will reference the table, create the new columns you specify, filter columns if you want and so on and create a new CAS table with that information.

Try this code. It's using most of the code from the last example of this blog. Let me know if this works.

* Storing the Calculated Columns in a Variable *;
proc cas;
source createColumns;
Total_Price = Price * Quantity;
Product_fix = upcase(Product);
if Return = "" then Return_fix = "No";
else Return_fix = "Yes";
endsource;

productsTbl = {name = 'products',
caslib = 'casuser',
computedVarsProgram = createColumns
};

table.fetch / table = productsTbl;

* Create and promote a new table in CASL *;
table.copyTable /
table = productsTbl,
casOut = {name = 'final_table', /*New table information */
caslib = 'casuser',
promote = TRUE};

* Confirm the new table exists. It'll also identify the table is promoted *;
table.tableInfo / caslib = 'casuser';
quit;