LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (February 2012, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 29 Feb 2012 09:20:42 -0500
Reply-To:     Jim Groeneveld <jim.1stat@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jim Groeneveld <jim.1stat@YAHOO.COM>
Subject:      Re: Display no observations

Hi SAS Quest,

I don't entirely understand what you want. But if what you want is (a page with) an appropriate message when an analysis dataset is empty (no observations, any variables) where you would otherwise have no (table) output at all (e.g. from PROC REPORT) you may use my macro N0cases.sas from http://jim.groeneveld.eu.tf/software/SASmacro/N0Cases.zip

Call the macro (specifying the right parameters) at the same location(s) as your output table procedure(s). Then you'l always get one piece of output, either your table if the dataset is not empty or a message about the empty dataset (that you may define).

The advantage is that all TITLEs and FOOTNOTEs remain active and are contained in the output as well. So you can see which analysis did not produce statistical output.

Regards - Jim. -- Jim Groeneveld, Netherlands Statistician/SAS consultant http://jim.groeneveld.eu.tf

On Fri, 24 Feb 2012 09:58:26 -0500, sas quest <sasquest@GMAIL.COM> wrote:

>Hi, > >I want to assign a value to a variable as "No observations" from an >empty dataset that changes its variables each time it is run. The >dataset is inside a complex macro. > > I know many ways to create it and display it but inside the macro i >find it difficult................ > >i need something like this: > >data abc; >set xyz; > >/*code needed here to create var*/ > >&var="No observations"; >run; > >The above macro variable "var" should be chosen from the datset xyz >which changes its variable names dynamically. > > >Thanks in advance


Back to: Top of message | Previous page | Main SAS-L page