Can you please help to change SAS EG dates? it's SAS EG version: 5.1
this is the current format I dont want
Type: Character Length:500
Group: Character
Format: $500.
Informat:$500.
2014-01-01 00:00:00
2014-01-01 00:00:00
2014-01-01 00:00:00
I want this below format
Type: Numeric Length: 8
Group: Date
Format:DATETIME20.
Informat:DATETIME20.
01JAN2014:00:00:00
01JAN2014:00:00:00
01JAN2014:00:00:00
Your help is greatly appreciated.
Are you importing a file using the EG wizard? If so, you can change the type and format of the data in the wizard. If not, then what are you doing that is creating these text formats?
I tried to change it in the wizard but after I changed the whole column become blank.
Use the conversion function
input(date_var, anydtdtm.)
You can use this in a query with a calculate column or in a data step.
Reeza - Do you mean like the following?
newdatecolumn = input(date_var, anydtdtm.)
Can you explain more?
In a query, create a calculated field, custom calculation, using the above formula.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.