Dear
You can have a look on this type of code, include it inside a macro program :
It test if the file exist and backup it .
%let file_src=&original_path./my_file.txt;
%let flag_csc_exist=NO;
data _null_;
fname="tempfile";
rc=filename(fname,"&file_src");
if rc = 0 and fexist(fname) then call symput ('flag_csc_exist','YES');
rc=filename(fname);
run;
%if &flag_csc_exist eq YES %then %do;
%put I must move the file ;
%let file_src_ar=&original_path./archive/my_file.txt_%TRIM(%QSYSFUNC(DATE(), YYMMDDN8.));
filename src_file "&file_src";
filename tgt_file "&file_src_ar";
data _null_;
infile src_file;
file tgt_file;
input;
put _infile_;
run;
filename src_file clear;
filename tgt_file clear;
%end;