I want to rename a variable of a dataset with the first element of list macro variable that is a numeric code. I used this: proc sql noprint;create table prova_new as selectdrg_new, _c2_ as '%scan('&top10.',1,',')'nfrom prova;quit; but it doesn't work: ERROR 22...
Using the names and Rename statement for calling the labels and looking at the VIEWTABLE window on theSAScan be parsed out of the command line representing variable names. To Run the PROC data contents from the dataset, which helps to see the labels and execute the statements if only the s...
Right now, the variable name for UER in each small data set is like '...URN'. There's no underscore in the name. The front part contains different letters and sometime numbers. Can someone please help me to solve this problem? I really appreciate. Thanks in advance, ...
from sashelp.vcolumn where libname="%upcase(&lib)" and memname="%upcase(&dsn)" and upcase(substr(name,1,2))='DX'; proc datasets lib=&lib; modify &dsn; rename &names; quit; proc contents data=&lib..&dsn;run; 0 Likes MikeZdeb Rhodochrosite | Level 12 Re: Rename Variable Lis...
Hello all, I try to rename a variable and then keep only several variables in the dataset, but I meet some problem, can anyone help me with the following code and tell me what went wrong, thank you so much! data nh.Dietaryday1_4yr; set nh.dr1iff_c (rename=(DR1DAY=DR1DAY_IFF...
Similar to @Kurt_Bremser's approach, but using a proc sql created macro variable: data test; infile datalines dsd; input Oldname : $150. Pre : $100. Post : $100. Newname : $150.; datalines; gr_major_get_yes, gr_major_get, yes, gr_major_get___yes gr_img_com_abn_metr_gyr,...
A macro variable (not the same thing as a macro) is needed. proc contents data=have out=_contents_ noprint; run; proc sql noprint; select cats(name,'=new_',substr(name,5)) into :renames separated by ' ' from have where name eqt 'IPN_'; run; proc datasets library=work; modify...