Desktop productivity for business analysts and programmers

Problem importing a date variable

Accepted Solution Solved
Reply
Contributor
Posts: 58
Accepted Solution

Problem importing a date variable

Hi, I'm attaching a txt file that is part of a database with more variables, but this column is the only one that gives problems.

If you open the file with a excel, you could show all dates until December, but if you use the Enterprise Guide to make the import you only get dates until Nov 29, but there are not December dates. Someones could help me please?

Attachment

Accepted Solutions
Solution
‎12-20-2013 08:48 AM
Trusted Advisor
Posts: 1,137

Re: Problem importing a date variable

Hi,

On close observation of the data provided by you in the txt file, the dates of December has typo error. The month "Dec" is mistyped as "Dic". This is the possible reason why the dates after 29Nov2013 are not being read. After 29Nov2013, the date started is 02Dic2013, which should have been 02Dec2013.

May be after making the change, all the dates should be read.

Please check.

Thanks,

Jag

Thanks,
Jag

View solution in original post


All Replies
Community Manager
Posts: 2,889

Re: Problem importing a date variable

These dates are locale-specific, so you need to make sure that your SAS session is running in the correct locale, and then select the appropriate NL* informat for your date format.

See this paper for more information:

http://support.sas.com/resources/papers/proceedings13/025-2013.pdf

Chris

Contributor
Posts: 58

Re: Problem importing a date variable

Hi, thanks for your help. I was about to try but a friend told me that your solution could create problems in other projects where date variables are correctly imported. We change the original software to generate the txt file with another date form that could be imported correctly by Sas. Thanks again, I didn't know about that possibility of change the sas standards to import.

Solution
‎12-20-2013 08:48 AM
Trusted Advisor
Posts: 1,137

Re: Problem importing a date variable

Hi,

On close observation of the data provided by you in the txt file, the dates of December has typo error. The month "Dec" is mistyped as "Dic". This is the possible reason why the dates after 29Nov2013 are not being read. After 29Nov2013, the date started is 02Dic2013, which should have been 02Dec2013.

May be after making the change, all the dates should be read.

Please check.

Thanks,

Jag

Thanks,
Jag
Community Manager
Posts: 2,889

Re: Problem importing a date variable

Jag - it wasn't a typo, it was in Spanish.  December => Diciembre en español...

Looks like the problem has been resolved though...

Trusted Advisor
Posts: 1,137

Re: Problem importing a date variable

Thank you Chris,

I thought it was a typo error as i saw the other names similar to English names.

Thanks,
Jag
Contributor
Posts: 58

Re: Problem importing a date variable

Exactly, in Spanish it's Diciembre. I will try to change the month to see what happens.

Contributor
Posts: 58

Re: Problem importing a date variable

You were totally right. Thank you very much.

Trusted Advisor
Posts: 1,137

Re: Problem importing a date variable

Thank you for checking this and confirming.

Thanks,
Jag
🔒 This topic is solved and locked.

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

Discussion stats
  • 8 replies
  • 309 views
  • 3 likes
  • 3 in conversation