07-22-2013 09:10 AM
I need generate some new variables based on a SAS data set.
Except creating user written code, how can I use SAS DI to generate a SAS data step to accomplish the task?
Thanks in advance!
07-22-2013 04:56 PM
You ae not keen on using 'user written code'?
If your task is fairly typical you can look into 'user written transformation'.
SAS code can also be inserted in the pre and post step sections in every other transformation.
07-23-2013 09:03 AM
Thank you for your response.
I purposely want to avoid user written code here. I have already created SAS code in EG, and now I am re-do the work in DI.
I want take advantage on the metadata generated by DI, and this is why I try to avoid user written code.
07-23-2013 06:21 AM
You will need to be more specific in what you have and what you want in order to give you an explicit answer.
On a general level:
There are multiple ways of creating additional variables in an target table based on variables in a source table. You could for example use an Extract or SQL Join tranformation, then add the variables to the target table and then in the mapping tab of the transformation map variables from source to target and define expressions as required for populating the new variables.
Using a Extract or SQL Join will generate SQL code and not SAS data step code - but this is something you shouldn't have to care about when using DIS.
07-23-2013 09:07 AM
Thank you so much for your response.
I did see SQL was generated when I use extract.
I posted the question is because I couldn't generate SAS code instead of SQL.
Since SAS document says SAS data step need less resources than SAS SQL. I have been wondering how I can generate SAS code?
Now I got another confirmation that DI doesn't do that. Thanks!
07-23-2013 05:37 PM
DIS might very well generate SAS Data Step code, e.g. the Lookup Transformation uses (data step) hash objects or in the Loader Transformation you can even choose between "Modify" (=data step) and SQL.