Date: Mon, 4 Jun 2001 14:08:09 -0600
Reply-To: Michael Gibson <michael_gibson@NOSPAM.STORTEK.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Michael Gibson <michael_gibson@NOSPAM.STORTEK.COM>
Organization: Storage Technology Corporation
Subject: Re: Overview of Data _Null_
Data _NULL_ can be used for generating dates used for selection or report
headers.
This is very handy for creating dynmic running reports that run each month,
without having to change the code.
It can also be used to create MACRO variables that are used for addational
processing else where in the code. These can be record counts or any other
type of information from a table.
Example of getting Dates:
--------------------------------
data _null_;
cur_date = today();
last_mth = intnx( MONTH, cur_date, -1);
call symput( 'curdte', put( cur_date, date9.));
call symput( 'lstdte',put( last_mth, date9.));
call symput( 'rpthead', put( last_mth, month. ));
run;
proc sql;
create table work.selected as
select * from database where row_add_dte between "&lstdte" and
"curdte";
quit;
title1 "my report for the month of &rpthead";
Michael G.
|