BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ybz12003
Rhodochrosite | Level 12

Hello:

 

I found the code didn't work when I tried to convert character to numeric.   All of the Date column "Concep" and "Bdate" become missing value ".", please advice how to fix it.  Thanks.

 

data want;
	set test (rename=(concep=_concep bdate=_bdate));
		concep=input(_concep, MMDDYY10.);
		bdate=input(_bdate,MMDDYY10.);
	format concep bdate MMDDYY10. ;
	drop _concep _bdate;
run;
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

What is length of your existing variable?

How is it justified?

Are the values in the form mm/dd/yyyy (or mm-dd-yyyy - something that is actually 10 characters ?)

 

Did you get any messages in the log about "invalid data for function input at line xx? If so show them.

 

View solution in original post

4 REPLIES 4
Astounding
PROC Star

Surely you know by now that we are only psychic on the weekends.  We lose our psychic superpowers on Monday. 

 

If you were to give us some examples of what your incoming variables contain, many of us could give you a valid answer.

Kurt_Bremser
Super User

Example data.

Example data.

Example data.

 

Did I say "example data" already?

 

Oh, and before I forget: example data!

 

 

After close to 400 posts here, that should be a total given. Really.

ballardw
Super User

What is length of your existing variable?

How is it justified?

Are the values in the form mm/dd/yyyy (or mm-dd-yyyy - something that is actually 10 characters ?)

 

Did you get any messages in the log about "invalid data for function input at line xx? If so show them.

 

ybz12003
Rhodochrosite | Level 12

Thanks for all of suggestion, I realized I put the wrong format. 

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
  • 4 replies
  • 837 views
  • 0 likes
  • 4 in conversation