BookmarkSubscribeRSS Feed
JCool42
Calcite | Level 5

We have an existing job running via Unix batch that utilizes ODS Excel.  Prior to our conversion to SAS 9.4M4 the following code put the proc report output and the proc gplot on the same tab.  We create multiple tabs  (ALL, MC, PL)   Prior to the conversion, the following code did this perfectly, now  all the data is in one tab.  I have reviewed all the OPTIONS for ODS Excel and I can find a reason for this.  Appreciate any help you can provide.   Additionally, when this code runs in SAS EG, multiple tabs are created.  When we run via batch submit, we get one tab only

 

ods excel file="filename..xls" style=normal;

ods noproctitle;

 

%macro doit(sheetname); 

 

ods excel options(embedded_titles='yes'

 

sheet_interval="none"

 

sheet_name = "&sheetname"

 

absolute_column_width='10,10,5');

 

proc tabulate data=all_months out=auths;

 

class disposition reason rar_transaction_date;

 

var authorizations;

 

table disposition*reason*(n='#'*f=comma12. colpctn='%'*f=5.2) (all='Total'*f=comma12.),

 

authorizations * rar_transaction_date=' ';

run;

 

ods graphics / height=500 width=2000 ;

 

ods listing gpath="%sysfunc(getoption(work))";

 

GOPTIONS device=ACTXIMG;

 

proc sgplot data=graph1;

 

title "Unit Rate";

 

vline rar_transaction_date / response=unit_rate ;

 

XAXIS label = 'Date';

 

YAXIS label = 'Unit Rate' GRID min=0;

 

run;

 

 

%doit(All,);

 

%doit(MC);

 

%doit(PL);

2 REPLIES 2
Haris
Lapis Lazuli | Level 10
Shot in the dark here but I found that OPTION ValidVarName defaults are different between Base SAS and SEG. SAS uses 'V7' which replaces spaces and non-SAS characters with underscores versus 'ANY' in SEG with puts the name in quotes and adds an 'n' to the end. For example, 'Variable Name' would be read as Variable_Name by base SAS but 'Variable Name'n by SEG. I suspect that your culprit is in general SAS options rather than ODS Excel options.
Cynthia_sas
SAS Super FREQ

Also, and this is minor, but could cause issues. When you use ODS EXCEL, the valid file extension is .XLSX (not .xls as your show). You should be getting a Microsoft warning window with .XLS as the file extension. Also GOPTIONS should not have an impact on PROC SGPLOT -- you should put your imagefmt= option in the ODS GRAPHICS statement.

cynthia

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