From: Andrew Z. on
I am moving some SAS 9 static reports to parameterized SAS EBI reports
accessed through Web Portal. If the user enters parameters that yield
no results, there is no output (for PROC PRINT, for example): this may
lead the user to believe the system is broken. I made a macro to check
for no observations, but I don't see a good way to display the error
message to the user (apparently through ODS).

I've tried various methods including

#1
ODS text='There are no results: try different parameters'

But SAS doesn't flush the output, so this is never displayed on its
own.

#2
data _null_;
input lines $ 1-80;
file print;
put _infile_;
cards;
There are no results: try different parameters
run;

But cards is not allowed in a macro (which I need to check the count
of observations)



Andrew
From: Ya on
On Aug 3, 12:15 pm, "Andrew Z." <ahz...(a)gmail.com> wrote:
> I am moving some SAS 9 static reports to parameterized SAS EBI reports
> accessed through Web Portal.  If the user enters parameters that yield
> no results, there is no output (for PROC PRINT, for example): this may
> lead the user to believe the system is broken. I made a macro to check
> for no observations, but I don't see a good way to display the error
> message to the user (apparently through ODS).
>
> I've tried various methods including
>
> #1
> ODS text='There are no results: try different parameters'
>
> But SAS doesn't flush the output, so this is never displayed on its
> own.
>
> #2
> data _null_;
>     input lines $ 1-80;
>     file print;
>     put _infile_;
> cards;
> There are no results: try different parameters
> run;
>
> But cards is not allowed in a macro (which I need to check the count
> of observations)
>
> Andrew

How about this?

data _null_;
file print;
put "There are no results: try different parameters";
run;

Ya
From: Andrew Z. on
On Aug 3, 1:19 pm, Ya <huang8...(a)gmail.com> wrote:
> On Aug 3, 12:15 pm, "Andrew Z." <ahz...(a)gmail.com> wrote:
>
>
>
> > I am moving some SAS 9 static reports to parameterized SAS EBI reports
> > accessed through Web Portal.  If the user enters parameters that yield
> > no results, there is no output (for PROC PRINT, for example): this may
> > lead the user to believe the system is broken. I made a macro to check
> > for no observations, but I don't see a good way to display the error
> > message to the user (apparently through ODS).
>
> > I've tried various methods including
>
> > #1
> > ODS text='There are no results: try different parameters'
>
> > But SAS doesn't flush the output, so this is never displayed on its
> > own.
>
> > #2
> > data _null_;
> >     input lines $ 1-80;
> >     file print;
> >     put _infile_;
> > cards;
> > There are no results: try different parameters
> > run;
>
> > But cards is not allowed in a macro (which I need to check the count
> > of observations)
>
> How about this?
>
> data _null_;
>      file print;
>      put "There are no results: try different parameters";
> run;

The log shows it executes, but ODS doesn't show any output.

NOTE: 1 lines were written to file PRINT.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.00 seconds




I also tried this

data _null_;
set sashelp.class;
if _n_ = 1
then
do;
declare odsout obj();
obj.format_text(data: "bla .. bla..");
end;
obj.format_text(data: name);
run;

https://groups.google.com/group/comp.soft-sys.sas/msg/ba35283eab034e48

Which gives the following log but still no output


WARNING: DATA step interface is preproduction in this release.
NOTE: DATA statement used (Total process time):
real time 0.02 seconds
cpu time 0.01 seconds

NOTE: There were 19 observations read from the data set SASHELP.CLASS.

Andrew
From: Ya on
On Aug 3, 12:58 pm, "Andrew Z." <ahz...(a)gmail.com> wrote:
> On Aug 3, 1:19 pm, Ya <huang8...(a)gmail.com> wrote:
>
>
>
>
>
> > On Aug 3, 12:15 pm, "Andrew Z." <ahz...(a)gmail.com> wrote:
>
> > > I am moving some SAS 9 static reports to parameterized SAS EBI reports
> > > accessed through Web Portal.  If the user enters parameters that yield
> > > no results, there is no output (for PROC PRINT, for example): this may
> > > lead the user to believe the system is broken. I made a macro to check
> > > for no observations, but I don't see a good way to display the error
> > > message to the user (apparently through ODS).
>
> > > I've tried various methods including
>
> > > #1
> > > ODS text='There are no results: try different parameters'
>
> > > But SAS doesn't flush the output, so this is never displayed on its
> > > own.
>
> > > #2
> > > data _null_;
> > >     input lines $ 1-80;
> > >     file print;
> > >     put _infile_;
> > > cards;
> > > There are no results: try different parameters
> > > run;
>
> > > But cards is not allowed in a macro (which I need to check the count
> > > of observations)
>
> > How about this?
>
> > data _null_;
> >      file print;
> >      put "There are no results: try different parameters";
> > run;
>
> The log shows it executes, but ODS doesn't show any output.
>
> NOTE: 1 lines were written to file PRINT.
> NOTE: DATA statement used (Total process time):
>       real time           0.02 seconds
>       cpu time            0.00 seconds
>
> I also tried this
>
> data _null_;
>        set sashelp.class;
>        if _n_ = 1
>        then
>           do;
>          declare odsout obj();
>          obj.format_text(data: "bla .. bla..");
>          end;
>       obj.format_text(data: name);
>    run;
>
> https://groups.google.com/group/comp.soft-sys.sas/msg/ba35283eab034e48
>
> Which gives the following log but still no output
>
> WARNING: DATA step interface is preproduction in this release.
> NOTE: DATA statement used (Total process time):
>       real time           0.02 seconds
>       cpu time            0.01 seconds
>
> NOTE: There were 19 observations read from the data set SASHELP.CLASS.
>
> Andrew- Hide quoted text -
>
> - Show quoted text -

The way you use ods data step interface is not quite right, you need
table_start(), tabel_end() statement.

A more simple way would be using proc print:

data dum;
a="There are no results: try different parameters";
run;

ods ...

proc print data=dum noobs label;
label a='A0'x;
run;

ods ... close;
 | 
Pages: 1
Prev: Difference from baseline
Next: autocall library