Hello, I'm using SAS base 9.4. In my library named "source", I have a dataset called "X_test". In this dataset, there is a column called "image_name" which contains the names of an image stored in my folder. I'm trying to write a macro that for each "image_name", go to a source folder, select the image and copy it into an other folder. Here the code I wrote but I don't know how to said to look in each column to get the file name. The error is that SAS doesn't have the image_name. I got "File incorrect" because image_name=. for SAS. Anyone have a solution to suggest me ? data _null_;
length source destin $8;
retain indir "C:/Users/Me/image_test_sas" outdir "C:/Users/Me/image_copy";
if fileexist (indir || '/' || image_name) then do;
rc = filename (source, indir || '/' || image_name);
rc = filename (destin, outdir || '/' || image_name);
rc = fcopy (source, destin);
if rc ne 0 then do;
msg = sysmsg();
putlog msg;
end;
rc = filename (source); call missing (source);
rc = filename (destin); call missing (destin);
end;
run; Thank you
... View more