BookmarkSubscribeRSS Feed
ThomasH
Calcite | Level 5
Hi there,

I am trying to enter a time8. format into a SAS dataset via edit mode in DI studio.

However, the system keeps on complaining about a wrong format unless I build a job to table-load an existing time8. value from another table into my target table.

Copy/Pasting exactly this value from the source does also not work.

How do I need to enter the time into a time8. cell?

Not working is:
- 1960-01-01 18:00:00
- 18:00:00

Thanks a lot and regards,
Thomas
4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:
There are 2 different concepts in regards to SAS Date/Time values:
1) How the number is DISPLAYed (using a SAS FORMAT) and,
2) how the number is INPUT -- if you are using SAS to perform data entry or reading data INTO a SAS dataset, then you must use a SAS INFORMAT.

What can be confusing is that the names of the FORMATs and INFORMATs can be the same. And just because you have a SAS FORMAT for display does not mean that you have a SAS INFORMAT for entering data via SAS.

Suppose for, example, that a person's birthdate is Nov 15, 1950. The "internal" value for that SAS date value is -3334. I can DISPLAY that number with the date9. FORMAT and then the DISPLAYed valued would be: 15NOV1950. If I wanted to perform data entry into a SAS dataset, without an INFORMAT, I would have to enter that date as -3334. If I had an INFORMAT of MMDDYY10., then I could type 11/15/1950 into a cell. If I had an INFORMAT of DATE9., then I could type 15NOV1950 into the cell.

Most times, folks don't worry about setting an INFORMAT because they're not doing "data entry" or they're not reading "raw data" into SAS such that they need an INFORMAT. However, you might check your table settings to make sure that both a FORMAT and an INFORMAT have been set for your dataset.

If you need more help using DIStudio or setting INFORMATS, you might consider contacting Tech Support.

cynthia
ThomasH
Calcite | Level 5
Hi Cynthia,

thanks - of course the informat is set. In this case, as stated, it's TIME8. However, I am not able to enter 18:00:00, 18.00.00, 1960-01-01 18:00:00...and looking for the correct way to enter it.

Rgds,
Thomas
LinusH
Tourmaline | Level 20
I reproduced your problem, and it seems like a bug to me. My Time8. formatted fiels are displayed as a datetime value, and it does not accept any time or datetime values I tried out. I suggest that you report this to tech support.

Linus
Data never sleeps
Cynthia_sas
SAS Super FREQ
I agree with Linus. If you have both an INFORMAT and a FORMAT set for the variable then this is an issue for Tech Support.

cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 984 views
  • 0 likes
  • 3 in conversation