Date: Mon, 29 Nov 2004 11:03:51 -0500
Reply-To: "Fehd, Ronald J." <RJF2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J." <RJF2@CDC.GOV>
Subject: Re: ERROR
Content-Type: text/plain; charset="us-ascii"
> From: Bhavani Shankar
> I have a data statement as follows
>
> data outdata.&busname._sched&year&month
> outdata.&busname._schedbad&year&month
> outdata.&busname._exclusions&year&month;
> format dateadded lease_begin_date mmddyy10. mthstomaturity 5.;
> set &data;
> on every iteration &Data is substituted by A , B , C ,D.
> And i need to consider the variable lease_begin_date only
> when &Data resolves to C (Set C) and for the remaining
> datasets ( from SET A ,SET B and SET D) I don't need the
> variable lease_begin_date How to drop this variable. If i
> don't drop i am getting an error for SET A ,SET B and SET D..
> ERROR: Variable lease_begin_date has been defined as both
> character and numeric. Thanks in advance. Bhavani
this is a problem of too little, too late
the correct place to apply formats to a data set
is in the program that creates the data set.
and the correct statement to do that is the
attrib lease_begin_date length = 8 format = mmddyy10.;
otherwise you end up with these unwieldly kludges:
format dateadded
%If &Data eq C then %do;lease_begin_date %end;
mmddyy10. mthstomaturity 5.;
Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
Efficiency is intelligent laziness. -David Dunham