Desktop productivity for business analysts and programmers

Switching to SAS EG and having PROC REPORT issues

Reply
New Contributor
Posts: 4

Switching to SAS EG and having PROC REPORT issues

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!

 

PROC Star
Posts: 295

Re: Switching to SAS EG and having PROC REPORT issues

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

New Contributor
Posts: 4

Re: Switching to SAS EG and having PROC REPORT issues

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.

 

PROC Star
Posts: 295

Re: Switching to SAS EG and having PROC REPORT issues

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.

PROC Star
Posts: 295

Re: Switching to SAS EG and having PROC REPORT issues

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.

Super User
Posts: 7,405

Re: Switching to SAS EG and having PROC REPORT issues

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 7,405

Re: Switching to SAS EG and having PROC REPORT issues

PS: Maxim 15: Know your playing field (operating system).

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
New Contributor
Posts: 4

Re: Switching to SAS EG and having PROC REPORT issues

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.

 

Super User
Posts: 7,405

Re: Switching to SAS EG and having PROC REPORT issues

Use proc export with dbms=excelcs, and supply the server name (of the PC Files Server) as stated in the respective documentation.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Super User
Posts: 11,110

Re: Switching to SAS EG and having PROC REPORT issues

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.

 

Ask a Question
Discussion stats
  • 9 replies
  • 196 views
  • 0 likes
  • 4 in conversation