BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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
1 REPLY 1

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 1034 views
  • 0 likes
  • 2 in conversation