BookmarkSubscribeRSS Feed
emma_madrid
Calcite | Level 5

Hello,

 

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?

 

Code used:

 

ODS EXCEL FILE=exprt

options(sheet_name="sheetname"
sheet_interval='none'
embedded_titles='yes'
autofilter='1-11'
FLOW="TABLES"
);
proc odstext;
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" ;
run;

 

Thanks!

4 REPLIES 4
SASJedi
SAS Super FREQ

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. 

Check out my Jedi SAS Tricks for SAS Users
emma_madrid
Calcite | Level 5

Thanks for the clue. I checked the code, but there is no reference to &SYSUSERID.

I also noticed it happens when the SAS program is executed in LINUX, not when i execute in EG.

Quentin
Super User

Did you try adding:

title;
footnote;

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.  

BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.
Quentin
Super User

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?

BASUG is hosting free webinars Next up: Mark Keintz presenting History Carried Forward, Future Carried Back: Mixing Time Series of Differing Frequencies on May 8. Register now at the Boston Area SAS Users Group event page: https://www.basug.org/events.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

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
  • 4 replies
  • 384 views
  • 2 likes
  • 3 in conversation