BookmarkSubscribeRSS Feed
sasuser_sk
Quartz | Level 8

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;

 

 

 

sasuser_sk_0-1626723590022.png

 

1 REPLY 1
japelin
Rhodochrosite | Level 12

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.

 

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 348 views
  • 0 likes
  • 2 in conversation