04-06-2015 10:49 AM
I have a dataset where LoginDt is created as Char27 format and i need to convert it to Datetime20. format. I tried input statement but it gives error:
CREATE table logout01 as
SELECT input(LoginDt,datetime20.) as logindt_cst, User_Id
NOTE: Invalid month value
NOTE: Invalid argument to function INPUT. Missing values may be generated.
Any help is really appreciated...
04-06-2015 12:35 PM
Since the datetime informat is looking for values like: 16mar2008:11:23:07 if any of the "month" values aren't (case insenstivie) jan, feb, mar, apr, may , jun, jul, aug, sep, oct, nov or dec then you will generate that message and a missing result.
I would modify your code to include the original value and then look for records where the result for the new variable is missing.
Offhand, I might guess you have JUNE vs JUN or JULY vs JUL or possibly some numeric months if you have data entered by different people or using a data source that doesn't validate the entered date portions very well.
04-06-2015 12:52 PM
Initially, we had similar values in the input dataset but as Numeric column (input column was defined as Numeric) and the below code worked - Now the input format is changed to Character and i could not convert it to Datetime20. format.
LoginDt as logindt_cst format datetime20.,
04-06-2015 02:18 PM
I changed as you suggested, its working... you are awesome. Thank you so much...
SELECT input(LoginDt,ymddttm24. ) as logindt_cst format datetime20. ,
User_Id from test.dataset_01;
Need further help from the community? Please ask a new question.