BookmarkSubscribeRSS Feed
brian_clark
Calcite | Level 5

Hello all,

 

I am pretty familiar with BASE SAS and have been coding for about 6-7 years.  However, we are switching over the SAS EG and have a SAS server and such instead of SAS operating onto your local machine.  Here is a basic report that worked in Base SAS but doesn't work in SAS EG.  Any insight in how to correct the issue or a new path to try would be greatly appreciated.

 

BASE SAS CODE that works

ODS HTML BODY = "\\fs01\office\DQG\Data Managers\003\CCP\TEST.XLS";

proc report data=test nowd

style(report)=[outputwidth=7in font_size=8pt font_face=calibri]

style(hdr)=[font_size=10pt background=CX4F89BE foreground=white

font_weight=bold font_face=calibri]

style(lines)=[just=left background=CX808080 font_size=9pt

foreground=white font_face=calibri font_weight=bold]

style(summary)=[background=lightgrey];

title 'Using ExcelXP';

column ('District IRN' RPTING_LEA_IRN) ('Grade Level' STATE_EQUIV_GRADE_LEVEL_CODE) ('Count' count) ;

define RPTING_LEA_IRN / group '';

define STATE_EQUIV_GRADE_LEVEL_CODE / group '';

define count / '';

run;

ods HTML CLOSE;

 

SAS EG CODE that doesn't work

ODS HTML BODY = "\\fs01\office\DQG\Data Managers\003\CCP\TEST.XLS";

proc report data=test nowd

style(report)=[outputwidth=7in font_size=8pt font_face=calibri]

style(hdr)=[font_size=10pt background=CX4F89BE foreground=white

font_weight=bold font_face=calibri]

style(lines)=[just=left background=CX808080 font_size=9pt

foreground=white font_face=calibri font_weight=bold]

style(summary)=[background=lightgrey];

title 'Using ExcelXP';

column ('District IRN' RPTING_LEA_IRN) ('Grade Level' STATE_EQUIV_GRADE_LEVEL_CODE) ('Count' count) ;

define RPTING_LEA_IRN / group '';

define STATE_EQUIV_GRADE_LEVEL_CODE / group '';

define count / '';

run;

ods HTML CLOSE;

 

Thanks again!

 

9 REPLIES 9
collinelliot
Barite | Level 11

What do you mean by it doesn't work? Is there an error in the log?

brian_clark
Calcite | Level 5

Correct!  I get two errors. 

The first error states insufficient authorization to access:

ERROR: Insufficient authorization to access /usr/local/config/Lev1/SASApp/\\fs01\office\DQG\Data Managers\003\CCP\TEST.XLS.

The second error states no body file:

ERROR: No body file. HTML output will not be created.

 

collinelliot
Barite | Level 11

I think the second error is related to the first.

 

Can you change the path to one where you are sure you have access and see if it works? And if it does, then I think you need to talk to your IT/SAS Admin about the permission issue when you're in the Unix environment.

collinelliot
Barite | Level 11

Actually, it might not be permission related at all. It's more likely windows/windows server vs. the unix box.  I'm not sure if you have any directories that are accessible in both, but it would not suprise me if not based on my experience.

Kurt_Bremser
Super User

Your SAS runs on UNIX, therefore you need to use UNIX filename syntax. And make sure that the SAS server has the resource from fs01 mounted, so you can find it in the server's filesystem.

brian_clark
Calcite | Level 5

When I talked to IT/ADMIN this is what they replied.

 

When you write to the file server (F01) you are actually contacting a SAS program called SAS PC file server. It handles the translation of UNIX type file systems to windows file system. It only works on a very specific set of Microsoft Office files.

 

The error I get shows it is trying to write the file to a file system on the SAS Linux server. That would tell me that SAS doesn’t recognize the file you are trying to create as a Microsoft Office format file. It could also indicate that the ODS HTML BODY directive doesn’t talk to the SAS interface that forwards the stuff to the PC file server.

 

ballardw
Super User

Using code like this to lie to Excel

ODS HTML BODY = "\\fs01\office\DQG\Data Managers\003\CCP\TEST.XLS"

has always been a poor, though somewhat common, choice. Save the files with the correct extension and use a FILE-Open or right click and open to view in a different program than the default.

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 9 replies
  • 1238 views
  • 0 likes
  • 4 in conversation