Three suggestions:
Use a date in the form of YYYYMMDD. That way system sorting tools will show the sets in calendar date order.
Second, do not use special characters like () in file names.
Third, always start an output file name/path with the drive (windows) or root of a mount point for a drive.
One way to may a suggested file
data _null_;
set CUSTAVG (obs=1) nobs=c;
call symputx('trans_n',c);
call symputx('yesterday',put(intnx('day',today(),-1),yymmddn8.));
run;
proc export data=CUSTAVG
outfile="/Outfile_file/Transactions&yesterday._&trans_n..csv"
REPLACE
DBMS=CSV;
run;
The NOB= option on the set statement returns the number of observations in the data set. This is just one way to get the info but may be the shortest. The Call Symputx places the value using a default format into a macro variable. Since already using a data step add in another step to use the INTNX function to get the previous day and use the YYMMDDN.8 format which generates values like 20230222.
The . is used to indicate the end of a macro variable. So when there is a macro variable next to the dot in an extension you need to add one so that the macro processor does not use the one intended for the extension.
If you really need to use less friendly dates or add () change the format in the Call Symputx and and the () to the name around the Trans_n macro variable.