Do you have a list of the CPORT files? Do you have the list in a dataset?
Are you certain that each CPORT file only contains one dataset? Do any of them contain multiple datasets? Or other SAS objects, like format catalogs? When there is only one dataset are you sure the name of the dataset matches the name of the CPORT file?
Assuming that each file has one and only one dataset and you have the list in a variable named FILENAME in a dataset named FILELIST you could build a macro and then call the macro once for file.
%macro convert_one
(infile=
,outdir=
,outfile=
,libref=sasfiles
,memname=
);
%if not %length(&memname) %then %let memname=%scan(&infile,-2,'./"\');
%if not %length(&outfile) %then %let outfile=&memname..csv;
filename intrans "&infile";
proc cimport infile=intrans library=&libref;
run;
proc export data=&libref..&memname file="&outdir/&outfile" dbms=csv;
run;
%mend convert_one;
Then your program to actually convert all of the files can just be generated from the list of files. For example by using a data step and CALL EXECUTE() function.
libname sasfiles 'C:\Users\Joaquin\Desktop';
%let outdir=C:\Users\Joaquin\Desktop\;
data _null_;
set filelist ;
call execute(cats('%nrstr(%convert_one)('
,'infile=',filename
,'outdir=',"&outdir"
,')'));
run;