BookmarkSubscribeRSS Feed
mlogan
Lapis Lazuli | Level 10

Hi All,

I want to create a date column (Date_recored) in my output dataset (have) and assign all observations as 01JAN2015 which is a date value.

 

The following code that I wrote create column which is $9., but I want the column as Date9.

 

Can someone help please.

 

 

Data want;
set have;
Date_recored ='01JAN2015';
run;

1 REPLY 1
Astounding
PROC Star

Marginally faster to eliminate the assignment statement ... other than that you're just missing a letter:

 

retain Date_recored "01Jan2015"d;

format date_recored date9.;

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!

How to choose a machine learning algorithm

Use this tutorial as a handy guide to weigh the pros and cons of these commonly used machine learning algorithms.

Find more tutorials on the SAS Users YouTube channel.

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