I have this program code in EG. It runs without error but gives a random name on the file $LN01309 as shown in pic below. Does anyone know how I can fix it? I have to further run export (excel) on this data but cannot due to weird file name. Please help me understand why it is giving this random name.
%let ReportName = Tracking;
%let local_save_folder = C:\ABC\DATA;
%let SAS_Folder = /sasdata/exports/;
%let Todays_Date = %SYSFUNC(DATE(), date9.);
%let ReportFileName = &ReportName..xlsx;
%put _all_;
ods excel file= "&SAS_Folder.&ReportFileName." options (sheet_interval='table' sheet_name='Loads' suppress_bylines='on' embedded_titles='ON' embedded_footnotes='ON');
title j=l " Q2 2021" ;
footnote j = l "Generated by the SAS System (&_SASSERVERNAME, &SYSSCPL) on %TRIM(%QSYSFUNC(DATE(), NLDATE20.)) at %TRIM(%SYSFUNC(TIME(), TIMEAMPM12.))";
PROC TABULATE DATA=WORK.FINAL_RESULT f=10.2 S=[foreground=black just = c vjust=c] ;
VAR ID;
CLASS "Group Nm"n / ORDER=UNFORMATTED MISSING style=[font_weight=medium just=c];
CLASS Week2/ ORDER=UNFORMATTED MISSING ;
classlevels Week2/style = {font_weight=bold width=1.5in};
classlevels "Group Nm"n /style = {font_weight=bold width=1in just =c };
TABLE /* Row Dimension */
Week2= '' all='Total',
/* Column Dimension */
'Group Nm'n = ''*(ID=''*N='') All=''*n='Total' ;
RUN; QUIT; title;footnote;
options nobyline;
ods excel options(sheet_interval='table' sheet_name='Sales' suppress_bylines='on' frozen_headers="6" );
TITLE1 justify= left color= black height=8pt "abc";
Title2 justify= left color= black height=8pt "xyz";
Title3 justify= left color= black height=8pt " Wholesale ";
Title4 justify= left color= black height=8pt " counts ";
Title5 justify= left color= black height=8pt " means ";
FOOTNOTE1 "Generated by the SAS System (&_SASSERVERNAME, &SYSSCPL) on %TRIM(%QSYSFUNC(DATE(), NLDATE20.)) at %TRIM(%SYSFUNC(TIME(), TIMEAMPM12.))";
FOOTNOTE;
FOOTNOTE1 "Generated by the SAS System (&_SASSERVERNAME, &SYSSCPL) on %TRIM(%QSYSFUNC(DATE(), NLDATE20.)) at %TRIM(%SYSFUNC(TIME(), TIMEAMPM12.))";
PROC TABULATE
DATA=WORK.EXTRACT;
VAR COUNT_DISTINCT_of_ID;
CLASS MFR_NM / ORDER=UNFORMATTED MISSING;
CLASS MDL_NM / ORDER=UNFORMATTED MISSING;
CLASS Date / ORDER=UNFORMATTED MISSING;
TABLE
/* ROW Statement */
MFR_NM=' ' *MDL_NM=' '
all = 'Total' ,
/* COLUMN Statement */
Date=' ' *(COUNT_DISTINCT_of_ID * Sum={LABEL="Sum"} )
all = 'Total' *(COUNT_DISTINCT_of_ID * Sum={LABEL="Sum"} ) ;
;
RUN; QUIT;
Title;FOOTNOTE;
ods excel close;
From the image, it looks like this is not an entity of an Excel file, but a link.
Anything that starts with #LN is a "fileref" automatically assigned by SAS, so you can check the actual file path with the following code.
proc print data=sashelp.vextfl noobs;
run;
Since the file reference name is assigned, you can use it as is in your program, but if you need the full path for subsequent processing, try to get the entity path from the vextfl dataset.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.