Date: Thu, 23 Mar 2006 13:08:53 -0600
Reply-To: Nishant Dholakia <nishant.dholakia@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Nishant Dholakia <nishant.dholakia@GMAIL.COM>
Subject: Re: title not printing
In-Reply-To: <200603231751.k2NHBfql019534@mailgw.cc.uga.edu>
Content-Type: text/plain; charset=ISO-8859-1
Hi,
Thanks for the reply. I was doing it on non interactive mode. I did close
the file and reopened it just to be sure.
Here's an example to get my point across better
*fyi : xxx is not empty*
eg
108 proc print data=xxx(obs=0);
109 title "test";
110 run;
NOTE: No observations in data set WORK.XXX
NOTE: PROCEDURE PRINT used:
real time 0.02 seconds
cpu time 0.02 seconds
Title is printed in this case.
However when I do this (*here log_file is not empty*)
%if &nob = %str(0) %then %do;
%put NO ERRORS OR WARNINGS;
proc print data=log_file (obs=0);
title2 "NO WARNINGS OR ERROR IN CODE ";
run;
%end;
**
* LOG*
MLOGIC(LOGCHECK): %IF condition &nob = 0 is TRUE
MLOGIC(LOGCHECK): %PUT NO ERRORS OR WARNINGS
NO ERRORS OR WARNINGS
MPRINT(LOGCHECK): proc print data=log_file(obs=0) ;
MPRINT(LOGCHECK): title2 "NO WARNINGS OR ERROR IN CODE ";
MPRINT(LOGCHECK): run;
NOTE: No observations in data set WORK.LOG_FILE.
NOTE: PROCEDURE PRINT used:
real time 0.00 seconds
cpu time 0.00 seconds
There is no title printed
This is what baffles me.
On 3/23/06, Venky Chakravarthy <swovcc@hotmail.com> wrote:
>
> Nishant,
>
> You are probably running interactively and have left overs from a previous
> run. Look carefully, if you have a Title you should have something in the
> body unless you do something fancy as in the second situation below.
>
> An empty data set will not print and should not be having a title printed
> either. To confirm this close and open your SAS session (after saving what
> you have :-).) and try to run the following as your first job.
>
> data test ;
> x = "abcdefg" ;
> stop ;
> run ;
>
> title "This is an empty dataset" ;
> proc print data = test ;
> run ;
>
> On the other hand if you really want to print the title with no body try
> the
> following:
>
> options nodate nonumber ;
> data test2 ;
> x = " " ;
> label x = "00"x ;
> run ;
>
> title "This is NOT REALLY an empty dataset" ;
> proc print data = test2 nobs label ;
> run ;
>
> Venky Chakravarthy
>
>
> On Thu, 23 Mar 2006 12:14:55 -0500, Nishant Dholakia
> <nishant.dholakia@GMAIL.COM> wrote:
>
> >I was trying to write in a code to analyse the logs produced. The program
> >works fine except for one minor issue. There is a proc print on an empty
> >dataset because I want to print out a title and after execution the title
> >does not print even though the proc print is executed.
> >This is the interesting part of the log
> >
> >NOTE: No observations were selected from data set WORK.LOG_FILE.
> >NOTE: There were 0 observations read from the data set WORK.LOG_FILE.
> > WHERE (UPCASE(log)=:'WARNING') or (UPCASE(log)='ERROR');
> >
> >NOTE: PROCEDURE PRINT used:
> > real time 0.00 seconds
> > cpu time 0.00 seconds
> >
> >Now does this mean that the print was not executed because real time as
> >well as cpu time is 0.
> >I tried proc print on several other empty datasets with only title
> >statementts and they run fine (as in the title is printed).
> >
> >Its just an interesting observation. Comments would be really welcome coz
> i
> >wont be able to sleep until I figure this one out...hope I am not doing
> >something really silly.
>
--
Nishant H. Dholakia
607 262 0860
"its your attitude not your aptitude that determines your altitude"