Hello,
I have the below code working:
I need help with looping the below code such that the loop works for length(name) number of times and new_name is completely replaced except for the first string.
I want all the _1 and _2... concatenated to produce a variable named new_name.
Please help.
%let string1=0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ;
%let string2=`~!@#$%^&*()-=_+[]\{}|:,./<>?†°¬ŒÏ¾ABCDEFGHIJKLMNOPQRSTUVWXYZ;
%put string1=&string1.;
%put string2=&string2.;
data encrypt;
set sashelp.class;
length new_name $25.;
new_name=name;
len=length(name);
new_name_1=substr(new_name,1,1);
new_name_2=substr(new_name,2,1);
index_1=index("&string1.",trim(new_name_1) );
index_2=index("&string1.",trim(new_name_2) );
_1=substr("&string2.",index_1,1);
_2=substr("&string2.",index_2,1);
drop new_name_1 new_name_2 index_1 index_2 len;
run;