- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 03-03-2010 12:16 AM
(1062 views)
data PrepForTabulate /view=PrepForTabulate;
set sales;
DateofSale=datepart(DateTimeofSale);
SameDayDelivery=timepart(DateTimeofSale)<='15:00:00't;
run;
proc print data = PrepForTabulate;
run;
When I run this code the DateTimeofSale column shows no result as do the Dateof Sale column . I think that i need to convert the date first but really stucked in doing it as I dont have any information on the width of the Date variable. The log says :-
403 data PrepForTabulate /view=PrepForTabulate;
404 set sales;
405 DateofSale=datepart(DateTimeofSale);
406 SameDayDelivery=timepart(DateTimeofSale)<='15:00:00't;
407 run;
NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
405:14
NOTE: DATA STEP view saved on file WORK.PREPFORTABULATE.
NOTE: A stored DATA STEP view cannot run under a different operating system.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.03 seconds
408 proc print data = PrepForTabulate;
409 run;
NOTE: Variable DateTimeofSale is uninitialized.
NOTE: Writing HTML Body file: sashtml20.htm
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
425 at 472:14 425 at 473:19
NOTE: View WORK.PREPFORTABULATE.VIEW used (Total process time):
real time 0.18 seconds
cpu time 0.20 seconds
Kindly guide as to what addition i need to make to data step in oredr that the new variable DateTimeofSale and DateofSale gives result.
Regards ,
siddharth
set sales;
DateofSale=datepart(DateTimeofSale);
SameDayDelivery=timepart(DateTimeofSale)<='15:00:00't;
run;
proc print data = PrepForTabulate;
run;
When I run this code the DateTimeofSale column shows no result as do the Dateof Sale column . I think that i need to convert the date first but really stucked in doing it as I dont have any information on the width of the Date variable. The log says :-
403 data PrepForTabulate /view=PrepForTabulate;
404 set sales;
405 DateofSale=datepart(DateTimeofSale);
406 SameDayDelivery=timepart(DateTimeofSale)<='15:00:00't;
407 run;
NOTE: Numeric values have been converted to character values at the places given by: (Line):(Column).
405:14
NOTE: DATA STEP view saved on file WORK.PREPFORTABULATE.
NOTE: A stored DATA STEP view cannot run under a different operating system.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.03 seconds
408 proc print data = PrepForTabulate;
409 run;
NOTE: Variable DateTimeofSale is uninitialized.
NOTE: Writing HTML Body file: sashtml20.htm
NOTE: Missing values were generated as a result of performing an operation on missing values.
Each place is given by: (Number of times) at (Line):(Column).
425 at 472:14 425 at 473:19
NOTE: View WORK.PREPFORTABULATE.VIEW used (Total process time):
real time 0.18 seconds
cpu time 0.20 seconds
Kindly guide as to what addition i need to make to data step in oredr that the new variable DateTimeofSale and DateofSale gives result.
Regards ,
siddharth
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi:
This posting doesn't seem complete. However, I wonder whether it's related to these previous postings which included DateTimeofSale in your code examples:
http://support.sas.com/forums/thread.jspa?messageID=32926肞
http://support.sas.com/forums/thread.jspa?messageID=32879聯
http://support.sas.com/forums/thread.jspa?messageID=32870聦
http://support.sas.com/forums/thread.jspa?messageID=32871聧
http://support.sas.com/forums/thread.jspa?messageID=32498绲
http://support.sas.com/forums/thread.jspa?messageID=32427纫
Recommended reading:
http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000178212.htm
SAS Language Reference: Concepts, About SAS Date, Time, and Datetime Values
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a002200738.htm
cynthia
This posting doesn't seem complete. However, I wonder whether it's related to these previous postings which included DateTimeofSale in your code examples:
http://support.sas.com/forums/thread.jspa?messageID=32926肞
http://support.sas.com/forums/thread.jspa?messageID=32879聯
http://support.sas.com/forums/thread.jspa?messageID=32870聦
http://support.sas.com/forums/thread.jspa?messageID=32871聧
http://support.sas.com/forums/thread.jspa?messageID=32498绲
http://support.sas.com/forums/thread.jspa?messageID=32427纫
Recommended reading:
http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000178212.htm
SAS Language Reference: Concepts, About SAS Date, Time, and Datetime Values
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a002200738.htm
cynthia