Online File

How to use this page


Rick Aster: Professional SAS Programming Logic: Contents

Chapter 7
Program
SAS date arithmetic


*
    THISWEEK.SAS
    A demonstration of SAS date arithmetic.
*;
DATA _NULL_;
   TODAY = DATE();
   YESTERDAY = TODAY - 1;
   TOMORROW = TODAY + 1;
   SUNDAY = TODAY - WEEKDAY(TODAY) + 1;
   MONDAY = SUNDAY + 1;
   TUESDAY = SUNDAY + 2;
   WEDNESDAY = SUNDAY + 3;
   THURSDAY = SUNDAY + 4;
   FRIDAY = SUNDAY + 5;
   SATURDAY = SUNDAY + 6;
   PUT 'Today is ' TODAY : WORDDATE.
       / 'Yesterday was ' YESTERDAY : WORDDATE.
       / 'Tomorrow is ' TOMORROW : WORDDATE.
       / 'This week, Sunday is ' SUNDAY : WORDDATE.
       / 'This week, Monday is ' MONDAY : WORDDATE.
       / 'This week, Tuesday is ' TUESDAY : WORDDATE.
       / 'This week, Wednesday is ' WEDNESDAY : WORDDATE.
       / 'This week, Thursday is ' THURSDAY : WORDDATE.
       / 'This week, Friday is ' FRIDAY : WORDDATE.
       / 'This week, Saturday is ' SATURDAY : WORDDATE.
       ;
RUN;

 O /\

Global
Statements

RICK ASTER

SAS

BOOKS

Tech | Dictionary

Download | Rastinate

Rick Aster

Professional SAS Programming Logic

Contents/Online Files

Corrections

Catalog Page