![]() Though do think about what you are going to do further with the data as my question above. Any predicate functions passed as arguments to select () or renamewith () must be wrapped in where (). The matching select statements have been superseded by the combination of a select () + renamewith (). ![]() If _n_=1 then call execute('data want set have (rename=('||strip(name)||'='||strip(name)||'_2008') Įlse call execute(' '||strip(name)||'='||strip(name)||'_2008') renameif (), renameat (), and renameall () have been superseded by renamewith (). Set sashelp.vcolumn (where=(libname="WORK" and memname="HAVE")) end=last If you really want to do it at once, put a regular expression into your advanced search/replace function. Is replacing " symbololdname" string with " symbolnewname" string with " Match only a whole word" option selected in a C++ source code file actually a renaming of tha. If there is a specific reason why you need 2008 as part of the variable name then I would suggest you need to think about your data differently, normalize it:Īs for technically, then yes, there are many postings on here with methods to do this. , 05:24 If the variables are in this order, the code could be as simple as Code: rename (Length1-Length60) (len ()) ,addnumber It takes a while to internalize (and appreciate) the new rename syntax, but it is worth the reading. Over and of functions and such like also work lists of variables so you would lose that as well. The following code shows how to rename just the x variable in the dataset: /rename one variable/ data newdata set originaldata (rename (xnewx)) run /view new dataset/ proc print datanewdata Notice that x has been renamed to newx, but every other variable name remained the same. rename pop jan: Adds prex jan to all variables ending in pop, for example, age1pop to janage1pop, :. For instance an array statement of:Īrray some_name $200. ![]() Firstly my question would be why? The reason is that SAS has native functionality to deal with lists of variables with a numeric suffix, if you apply your logic to them they lose all that functionality.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |