BookmarkSubscribeRSS Feed
deleted_user
Not applicable
When I submit the SAS program as below, the log only shows the line numbers read successfully but no output displays in the OUTPUT. I clear all the log and output and repeat the program several times, the same happens. However, when I quit and invoke SAS again, the program runs and output is shown. This problem happens frequently in running the program. What is the problem ?

e.g.
options PS=90 LS=120 nodate nocenter nonumber;

libname temp 'c:\work';

data tt;
infile 'c:\t.txt';
input year 1-4 district 5-14 residence 15-24 travel 25-27 weight 28-42;
run;

proc sql;
create table temp.work as
select year, district, travel, weight
from tt where year=2009;
quit;
run;

data test;
set temp.work;
if district in (1,2,3) then travel=99;
run;

proc format;
value mode 1='Train'
2='Car'
3='Plane'
4='Ship'
5='On foot'
99='Others';
run;

proc tabulate data=test F=comma12. noseps;
class year district travel;
var weight;
format travel mmode.;
table district=''*travel='' all='Overall', year=''*weight=''*sum='' /rts=25;
run;


Please advise.
13 REPLIES 13
Robert_Bardos
Fluorite | Level 6
Are you saying you don't see your statements (be that proc or data step statements) displayed on the log after the first (or first n) executions? That might indicate an open comment statement, a non terminated bracketed or quoted element. If this is the case then you might try what is sometimes referred to as "magic string", ie. the sequence
[pre]
*'; *"; *); */; %mend; run;
[/pre]
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Suggest you share with the forum "exact SAS generated log output" not a copy of your code-piece, in order to receive accurate and objective feedback (as well as can be handled through this forum). Otherwise, suggest you contact SAS technical support, where you will likely need to do the same.

And, add this command at the very beginning of your SAS program in order to generate the most complete output -- then desk-check the log yourself before re-posting, just in case you missed something.

OPTIONS SOURCE SOURCE2 MACROGEN SYMBOLGEN MPRINT /* MLOGIC */;

Scott Barry
SBBWorks, Inc.
Reeza
Super User
Check your proc tabulate...you called the format with the wrong name, but I can't see that causing all that error....but thats why you check the log.
deleted_user
Not applicable
This is my SAS LOG with only the statements in line numbers without errors. No output is generated. I tried to submit CANCEL;END but same result happened. Could any expert please advise.

184
185 options ps=90 ls=200 nonumber nocenter;
186
187 data temp1;
188 infile 'c:\temp\f10.txt';
189 input period $1-7 trans $9 control $11-55 code $57-59 overall 61-70 status $72 mode $74 type $76;
190 run;
191
192 proc sort data=temp1 out=temp2;
193 by period trans;
194 run;
195
196 proc format;
197 value $mtrans 'A'=' Region'
198 'D'=' District';
199 value $mtype '1'=' Local'
200 '2'=' Overseas'
201 '3'=' Foreign'
202 '4'=' Resident'
203 '5'=' Others';
204 run;
205
206 data temp3;
207 set temp2;
208 run;
209
210 proc tabulate f=comma12.;
211 class period trans type;
212 var overall;
213 format trans $mtrans. type $mtype.;
214 table (trans=''*type='' all=''*type=''), period='calendar period'*overall=''*sum='' /rts=25;
215 run;
216
217 title;
218 run;
ArtC
Rhodochrosite | Level 12
Your TABLE statement has a mismatched quote after the SUM=

table district=''*travel='' all='Overall', year=''*weight=''*sum='' /rts=25;

Unclosed quotes tend to cause all sorts of havoc.
deleted_user
Not applicable
Thanks. But I could not find any unbalanced quote in my statement. Please explain.

table (trans=''*type='' all=''*type=''), period='calendar period'*overall=''*sum='' /rts=25;
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
So, where are SAS code lines 1 through 183? Your log starts at line 184, which is exactly what seems suspicious. Share the entire SAS Log with SAS generated messages included.

Scott Barry
SBBWorks, Inc.
twocanbazza
Quartz | Level 8
And your code supplied(orig post) is different to the code seen in the Log supplied
deleted_user
Not applicable
Thanks. I am referring to the my previous post on Oct-26-2010 8:26pm. Regarding the message lines in the LOG, they are automatically generated each time. So, the generation from from lines 184 in the LOG is the new result. No NOTE messages and TABULATION are displayed. Please help.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Honestly, from previous experience...I doubt the SAS code/log not shown reveals information. Share the entire SAS log so you can get the most productive feedback from individuals who troll this forum.

Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
Thanks to those experts in the reply.

May I make it clear that the previous post on Oct-26-2010 8:26pm already contained the entire LOG results. No NOTES/WARNINGS/ERRORS in the LOG as shown are revealed and no further tabulation as displayed in the OUTPUT window although PROC TABULATE in the SAS statement is added. Please help.
Cynthia_sas
SAS Super FREQ
Hi:
If you close down your SAS session and restart SAS and resubmit this code and ONLY this code -- so that your log starts at line #1 instead of line #184, do you see the same issue?? Can you replicate this behavior -- reliably, every single time you submit this code and ONLY this code????

In my experience, when you get a log without any messages, it is usually because you are either so deep into "bad quote" land or "nested and unclosed macro definition" land -- that the SAS compiler ceases to pass code to be executed. I suspect that you had errors (mismatched quotes, or unclosed macro definitions) prior to log line #184. Usually, when you close and reopen SAS you force a "reset" of the unclosed macro definition or clear the bad quotes.

It is entirely possible that there is -nothing- wrong with the code you posted -- and that THIS code was merely suffering from previously uncorrected errors/issues.

(Although, as an aside, it is hard to see whether you have single quote-space-single quote (' ') or single quote-single quote ('') or an unmatched double quote (") in your Tabulate code.)

Without seeing the code you submitted BEFORE the log you posted on Oct 26, any suggestions offered are sheer speculation.

cynthia
Ksharp
Super User
Hi.
I meet the same problem before.
You can click 'break' button to cancel the code you submited,then SAS can work.

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 13 replies
  • 3964 views
  • 0 likes
  • 8 in conversation