11-03-2017 06:15 AM
I have quite a basic requirement to insert a record into a table and based on a hard coded sql statement using SAS DI.
Initially I thought I could use a insert row transform but this requires a source table. So what is the best way of doing this?
11-03-2017 06:22 AM
Perhaps providing some information, examples about your question would be helpful.
At a guess, SQL needs at least one source record to insert a record in a dataset, so just choose one of the sashlpe datasets which you can identify the one record from and use that with a where - or alternatively, create a dataset with one row and use that. Without any other info not sure what to say.
11-03-2017 07:08 AM
11-03-2017 07:14 AM
Its advisable to show specific examples, I can't see your process. I also don't know what "This will be hardcoded as a sql statement so there is no source table." means. At a guess, and I show a specific example to show what I have taken from your text:
data have; length a b $50; output; output; run; proc sql; update have set a="1-Unknown", b="1-Unknown"; quit;
11-03-2017 07:11 PM
Assuming the target table exists and is never empty: Just use the target table also as source table, select only 1 record (if it's a SAS table then use obs=1) and then use the expressions to set the columns to the values of your choosing before loading into the target table.
You can use the APPEND transformation for all of this.