SAS EG Dates

Reply
Contributor
Posts: 49

SAS EG Dates

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

FormatSmiley Very HappyATETIME20.

InformatSmiley Very HappyATETIME20.

01JAN2014:00:00:00

01JAN2014:00:00:00

01JAN2014:00:00:00

Your help is greatly appreciated.

Super Contributor
Posts: 578

Re: SAS EG Dates

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?

Contributor
Posts: 49

Re: SAS EG Dates

I tried to change it in the wizard but after I changed the whole column become blank.

Super User
Posts: 17,733

Re: SAS EG Dates

Use the conversion function

input(date_var, anydtdtm.)

You can use this in a query with a calculate column or in a data step.

Contributor
Posts: 49

Re: SAS EG Dates

Reeza - Do you mean like the following?
newdatecolumn = input(date_var, anydtdtm.)

Can you explain more?

Super User
Posts: 17,733

Re: SAS EG Dates

In a query, create a calculated field, custom calculation, using the above formula.

Ask a Question
Discussion stats
  • 5 replies
  • 442 views
  • 0 likes
  • 3 in conversation