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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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