26 %macro mf_getfilesize(fpath=,libds=0,format=NO
    29   %
if &libds ne 0 %then %
do;
    30     %let fpath=%sysfunc(pathname(%scan(&libds,1,.)))/%scan(&libds,2,.).sas7bdat;
    33   %local rc fid fref bytes;
    34   %let rc=%sysfunc(filename(fref,&fpath));
    35   %let fid=%sysfunc(fopen(&fref));
    36   %let bytes=%sysfunc(finfo(&fid,File Size (bytes)));
    37   %let rc=%sysfunc(fclose(&fid));
    38   %let rc=%sysfunc(filename(fref));
    40   %
if &format=NO %then %
do;
    44     %sysfunc(INPUTN(&bytes, best.),sizekmg.)