BookmarkSubscribeRSS Feed
sam369
Obsidian | Level 7

Hi all,

data have;

input pid dt $22.;

cards;

100 08 NOV 2013

100 09 DEC 2014

100 28 JAN 2014

;

run;

for dt variable format is $22. and informat is $22.

i need to create a new variable , dt converted in to numeric date

want:

  pid     dt                    newdt

  100 08 NOV 2013      19645(these are rough values)

100 09 DEC 2014        19685(these are rough values)

100 28 JAN 2014         19825(these are rough values)

;

1 REPLY 1
sam369
Obsidian | Level 7

Hi all

i got the required output

sorry to post

CODE:

_dt=compress(dt);

newdt=input(_dt,date9.);

thanks

Sam

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
  • 669 views
  • 0 likes
  • 1 in conversation