Solved

Converting data from a text field to a formatted field date - SAS

Posted on 2011-09-04
1
410 Views
Last Modified: 2013-11-16
i am reading data in from a text field where  it is entered in different formats.

     i.e      1-1.11
               1-01-2011
               1/1/2011

I need the output to  be in format  mm/dd/yyyy  01/01/2011

Is there a way to do this with the inconsistencies in data input?
             
0
Comment
Question by:morinia
1 Comment
 
LVL 14

Accepted Solution

by:
Aloysius Low earned 500 total points
ID: 36481983
you could try the anydtdte informat:

data [output];
set [input];
converted_date=input([string date text column], ANYDTDTE.);
format converted_date mmddyy10.;
run;

the above display the value in mmddyy format, but the actual value stored will be a sas date

if you want the dates as a text value, then change the format statement to something like converted_date_mdy = put(converted_date, mmddyy10.);
0

Featured Post

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
FRM-40735:KEY-COMMIT trigger raised unhandled exception ORA-01422 7 71
Best RAID for a BDD Oracle 4 69
Sql Join Problem 2 43
Merging spreadsheets 8 37
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
APEX (Application Express) is used to develop a web application from Oracle. SQL Workshop is one of the tools that comes with Oracle APEX to query or modify the database objects or to make any changes to the structure.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question