BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
RBJ
Fluorite | Level 6 RBJ
Fluorite | Level 6

I am not able to store out from my SAS on Demand results window in a file. Here is the program I wrte but got errors like no exclude select command. Any help how to store rtf and pdf file from results window in SAS On Demand.

Ods rtf file=’/home/jain.ram.b/Prgs/output.rtf’;

Proc freq data=x; tables gender race; run;

Ods rtf close;

1 ACCEPTED SOLUTION

Accepted Solutions
RBJ
Fluorite | Level 6 RBJ
Fluorite | Level 6

Yes, this program does run OK. But, this means you can only store your results window data in your "home" folder only. Thus is NOT OK. I have been programming SAS for the last 20 years and I have many folders and subfolders which someone found some kind of a mistake. Someobe found "%include" statement some kind of mistake. I should be able to store my results log data in any folder or subfolder. Yes, it is something that need to go to Tech Support and I will. Thanks anyway. This post should be closed.

View solution in original post

5 REPLIES 5
Cynthia_sas
SAS Super FREQ

Hi:

  Using ODS RTF statements to write your output to a file you can download on your machine is correct, but something about your path does not look quite right. Mostly SAS OnDemand user IDs start with u, as in u12345678, so your path in the posting shows a userid of jain.ram.b, which doesn't quite look right for an OnDemand userID:

Cynthia_sas_1-1640372502394.png

 

  In the example above, I would expect that you could right click on Files (Home) top node and choose Properties, then that will show you your HOME folder path. Next, I would expand the Files (Home) location and look for the Prgs folder and right click on it an choose Properties and that will show you the correct path, in the correct case, for your FILE= option. Remember that Unix based systems are case sensitive, so PRGS, Prgs, and prgs would be considered 3 different folder names. This is why using the Properties method is so critical.

  There are some older userIDs that might not start with the letter 'u', but even so, using the Properties method should show you EXACTLY what the correct path should be for your FILE= option.

  I am also a bit confused by your description of "no exclude select command" -- which sounds like a different problem. It might be useful to post your log or a screen shot of your log that shows the EXACT error message in context. I'd recommend getting the FILE= location correct first and see whether your error messages go away.

Cynthia

 

RBJ
Fluorite | Level 6 RBJ
Fluorite | Level 6

Here is the copy of the program and there was nothing wrong with the path statement:

%include '/home/jain.ram.b/Macros/all_fmts.sas';
%include '/home/jain.ram.b/Macros/all_macros.sas';
libname ym '/home/jain.ram.b/MyData';
libname pfkl '/home/jain.ram.b/Progs/PFAAKL';


ods rtf '/home/jain.ram.b/Progs/PFAAKL/out.rtf';
proc freq data = pfkl.pfkl; tables mckd; run;
ods rtf close;

and I am copying here the error statement:

ERROR: 22-322 Syntax error: expecting one of the following: EXCLUDE, SELECT

ERROR: 76-322 Syntax error statement will be ignored.

Cynthia_sas
SAS Super FREQ

Hi:
I recommend that you turn on
OPTIONS MPRINT SYMBOLGEN;
and re-run your code. Then post your whole log, not just the 2 error messages. Based on the code you're showing, the error messages don't make sense. I do note that your original code showed a FILE= option in the ODS RTF statement, but the code you've just posted does not show a FILE= option. So, this is another reason why seeing your real log, not just the 2 error messages would be useful. What is in the 2 .SAS programs that you are doing a %INCLUDE on? Are there any housekeeping statements in those programs or code snippets that are doing some kind of EXCLUDE ALL???
Without more context for your error messages, the only thing I can suggest is that you open a track with Tech Support.
Cynthia

Sajid01
Meteorite | Level 14

Hello @RBJ 
As @Cynthia_sas rightly pointed out the error is with your folder path.
Here is the code that works on SAS on Demand for Academics

Ods rtf file='/home/your_folder_name/test.rtf';
Proc freq data=sashelp.class; tables sex ; run;
Ods rtf close;

if the code does not work, please post the log.

RBJ
Fluorite | Level 6 RBJ
Fluorite | Level 6

Yes, this program does run OK. But, this means you can only store your results window data in your "home" folder only. Thus is NOT OK. I have been programming SAS for the last 20 years and I have many folders and subfolders which someone found some kind of a mistake. Someobe found "%include" statement some kind of mistake. I should be able to store my results log data in any folder or subfolder. Yes, it is something that need to go to Tech Support and I will. Thanks anyway. This post should be closed.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!

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