Online File

How to use this page


Rick Aster: Professional SAS Programming Secrets: Contents

Chapter 13
Program 13b
Macro logic for no-data report


*
  Professional SAS Programming Secrets
  Program 13b
  Macro logic for no-data report
*;

%* These statements must be placed inside a macro. *;
%LOCAL DSID RC OBS;
%LET DSID = %SYSFUNC(OPEN(work.newwarranty, I));
%IF &DSID. > 0 %THEN %LET OBS = %SYSFUNC(ATTRN(&DSID., NLOBS));
%ELSE %LET OBS = 0;
%LET RC = %SYSFUNC(CLOSE(&DSID.));
%IF &OBS. > 0 %THEN %DO;
*
   Regular data report.
*
proc print data=work.newwarranty;
run;
%END;
%ELSE %DO;
*
   No-data report.
*;
proc print data=main.notrans;
run;
%END;

 O /\

Global
Statements

RICK ASTER

SAS

BOOKS

Tech | Dictionary

Download | Rastinate

Rick Aster

Professional SAS Programming Secrets

Contents/Online Files

Corrections