I was able to generate an excel file with ODS EXCEL and I added 3 lines at the beginning of the file using proc odstext; Everything works fine except that the user sas name is added twice in the generated excel. Once at the beginning before the proc odstext and once before starting the table.
Any idea to avoid inserting the user sas name?
ODS EXCEL FILE=exprt
p "Title1" / style=[color=#003366 font_weight=bold];
p "Title2 %sysfunc(UPCASE(%sysfunc(compress(&Date)))) %sysfunc(year("&Date."d))" / style=[color=#003366 font_weight=bold];
p "Title3" ;
Running the code you provided here does not recreate the problem for me. I suspect the userID is being inserted by some of the other code. Look for a reference to &SYSUSERID - this is the macro variable that contains the username of the person or system user executing the code.
Did you try adding:
immediately before the PROC ODSTEXT step?
When you run code via EG, you're probably running SAS on linux. When you say the problem only happens on Linux, how are you running that code? Are you batch submitting on linux? It's possible your SAS session has a different autoexec or other config setting that is creating titles/footnotes automatically.
Any chance you have a Title and Footnote that are generating the username? If you add:
title1 ; footnote1 ;
before the code to clear titles and footnotes does that solve the problem?
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.