The UPDATE statement performs rowwise updates of the data in an in-memory table.
specifies the name of the variable to update.
specifies the value to assign to the variable.
specifies the libref
and table name of a SAS data set to use for updating the in-memory
table. The data set must contain the variables and values that you
want to update. You can specify a _WHERE_
variable
in the data set to apply as a filter to the particular set of update
values. This clause in the data set augments the overall WHERE clause,
if one is specified.
specifies a file reference to a SAS program to use for the row update (an update script). You can combine the specification of a SAS program through the CODE= option with the name-value pair specification or the DATA= specification for bulk updates. The updates that are specified in the name-value pair and DATE= specifications are performed first and then the update script executes on the modified row to produce the update.
Alias | PGM= |
prevents the procedure from pre-parsing and pre-generating code for temporary expressions, scoring programs, and other user-written SAS statements.
Alias | NOPREP |
saves the result table so that you can use it in other IMSTAT procedure statements like STORE, REPLAY, and FREE. The value for table-name must be unique within the scope of the procedure execution. The name of a table that has been freed with the FREE statement can be used again in subsequent SAVE= options.
specifies either a quoted string that contains the SAS expression that defines the temporary variables or a file reference to an external file with the SAS statements.
Alias | TE= |
specifies the list of temporary variables for the request. Each temporary variable must be defined through SAS statements that you supply with the TEMPEXPRESS= option.
Alias | TN= |
ODS Table Name
|
Description
|
Option
|
---|---|---|
RowUpdate
|
Number of Rows Considered
for an Update
|
Default
|
libname example sasiola host="grid001.example.com" port=10010 tag=hps; data example.prdsale; set sashelp.prdsale; run; filename pgm "some-path/update.pgm"; 1 data _null_; file pgm; put "if quarter=3 and product eq 'SOFA' then do;"; put " predict = 1.05 * predict;"; put "end;"; put "if quarter=3 and product ne 'SOFA' then do;"; put " predict = 1.03 * predict;"; put "end;"; run; proc imstat data=example.prdsale; 2 /* columninfo; */ /* fetch / format; */ update / code=pgm; run; where quarter=3; fetch / format; quit;
1 | The FILENAME statement and the DATA statement are used to write a simple SAS program to a file. The file reference, Pgm, is used later in the UPDATE statement. |
2 | In the PROC IMSTAT example, the COLUMNINFO and FETCH statements are enclosed in comments, but they are helpful for helping you understand the data. The UPDATE statement uses the CODE= option to specify the file reference. The WHERE statement and FETCH statements are used to display the first 20 rows that were updated. |
libname example sasiola host="grid001.example.com" port=10010 tag=hps; data example.tableA; 1 do x=11 to 20; data = x; output; end; run; data pgm; 2 length _where_ $64; _where_ = "x between 5 and 13"; data = 10; output; _where_ = "x between 14 and 30"; data = 15; output; run; proc imstat data=example.tableA; fetch / format; run; quit; proc imstat data=lasr.tableA; update data=pgm; 3 run; fetch / format orderby=(x); quit;
1 | The SAS LASR Analytic Server engine and a DATA step are used to create a simple in-memory table with columns named x and Data. |
2 | A data set, named Pgm, is created in the Work library. The data set describes two updates to make an in-memory table. The _WHERE_ column is used to specify the rows to modify. |
3 | The DATA= option is used to specify the data set with the update instructions. |