Hi, I took a stab at this. It's rudimentary, but hopefully it's enough to get you going. It reads a SAS program one line at a time, and converts each character using a "key" which can be changed to your liking. It then writes each character out to an output file (obfuscated, if you will). You can call the same macro with an inverse (?) of the key to un-obfuscate it to another output file. filename testfile '/<some path>/<some original program>.sas'; filename fileout1 '/<some path>/<some obfuscated program>.sas'; filename fileout2 '/<some path>/<un-obfuscated program>.sas'; %macro obfuscate(key=,filein=testfile, fileout=fileout1); data garble1; infile &filein truncover length=linesize; file &fileout ; length record $80. asc_char_in varylen key 8.; varylen=80; key = &key; ; input record $varying. varylen; do i = 1 to linesize; asc_char_in=rank(substr(record,i,1)); char_out= byte(asc_char_in + key); put char_out $1. @; end; put; run; %mend; %obfuscate(key=_n_+7); %obfuscate(key=0-(_n_+7), filein=fileout1, fileout=fileout2);
... View more