Help using Base SAS procedures

Input error?

Accepted Solution Solved
Reply
Super Contributor
Posts: 398
Accepted Solution

Input error?

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;

Accepted Solutions
Solution
‎05-17-2018 10:53 AM
Super User
Posts: 13,563

Re: Input error?

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


All Replies
Super User
Posts: 6,781

Re: Input error?

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.

Super User
Posts: 10,270

Re: Input error?

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.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Solution
‎05-17-2018 10:53 AM
Super User
Posts: 13,563

Re: Input error?

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.

 

Super Contributor
Posts: 398

Re: Input error?

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

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 180 views
  • 0 likes
  • 4 in conversation