This is a situation where wrapping code into a macro can be handy.
First, let's wrap your import code into a macro and deal with the dataset name issue on the way:
%macro import_csv(filename);
filename csv "/home/kancym0/sasuser.v94/&filename..csv" termstr=LF;
proc import
datafile=csv
out=work.mycsv_&filename.
dbms=CSV
replace
;
run;
%mend;
Next, create a list of filenames to automate processing:
data files;
input filename $;
datalines;
DEF
K
QB
RB
ST
TE
WR
;
run;
Now, use that list to call the macro repeatedly:
data _null_;
set files;
call execute('%import_csv('!!trim(filename)!!');');
run;
If you don't need the list of filenames in a dataset for further processing, you can combine the last 2 steps into one data _null_ step.
... View more