11-08-2012 07:59 PM
I have incoming date time as '2012-04-05T-:-:-+00:00', with missing time zone represented with -, I am unable to convert it to datetime Numeric format.
But if I modify the date time as '2012-04-05T00:00:00+00:00' and use input(indate,e8601dz28.2); then it works.. May be I am not using the right informat..can anyone help?
11-09-2012 10:26 PM
No, you are doing everything right with the informat.
The problem is that when you have the dashes in your first example, there is no way to know what time they represent, therefore no way to convert your character indate variable to a correct time. When you change the dashes to zeroes, you are changing the time values to midnight. Is that what you want if the hour, minute, and second are dashes?
11-21-2012 03:14 PM
I remember reading in the SAS documentation that , SAS can read dashes(-) as missing values..
so ideally what I want is if the incoming dataset has dashes or zeros, SAS should be able to read them correctly and provide the non missing component of it..Is it possible?
so for firstcase '2012-04-05T-:-:-+00:00' output should be 5Apr12 and if there is a time present then show the time part as well..
If i give mydt = input('2012-10-9T-:-:-+00:00',e8601dz28.2); I get an error message..
11-21-2012 03:33 PM
Do you need the time part? If not, the following inputs just the dates:
informat date B8601da.;
format date date9.;
input date score;