As for the table.update you can use values returned back from a FEDSQL query, see example below.
One has to convert the type for numeric values and add quotes for char values to make it work
proc casutil;
load data=sashelp.class outcaslib="casuser" casout="class" replace;
load data=sashelp.class outcaslib="casuser" casout="class_update" replace;
run;
proc cas;
action fedsql.execdirect result=class_update status=sqlrc /
query="select name, age, height * 100 as newValue, trim( both from reverse(name) ) as newChar from casuser.class where age = 14"
;
describe class_update;
print sqlrc;
do row over class_update["Result Set"];
print row ;
/* convert value to string type */
newValue = catq("1", row["newValue"]);
/* add quotes for char value */
newchar = catq("a", row["newChar"]);
print "Updating: " row["name"];
action table.update status=updaterc /
table={
caslib="casuser" name="class_update"
where = catx(" ", " name = ", quote(trim(row["name"])) )
}
set={
{var="height", value=newValue }
{var="name", value=newChar }
}
;
print updaterc;
end;
/* action builtins.history;*/
run;
action table.fetch / table={caslib="casuser" name="class_update"};
run;
quit;
... View more