change chracter to yymmdd10.

Posted on 2011-10-14
Last Modified: 2013-11-16
i have date which is Chracter 10 in format 20101107155504 i want it to be converted to YYMMDD10.
Question by:sam2929
    LVL 14

    Accepted Solution

    you could do something like:

    data x;
    org_value = '20101107155504';
    date_only = input(substr(org_value, 1, 8), yymmdd8.);
    format date_only yymmdd10.;
    LVL 1

    Expert Comment

    Do you have a datetime as a character?

    data new; set old;
    date_time  = input(char_date_time, datetime18.);
    date= datepart(date_time);
    format date  yymmdd10.;

    Featured Post

    6 Surprising Benefits of Threat Intelligence

    All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

    Join & Write a Comment

    Suggested Solutions

    I annotated my article on ransomware somewhat extensively, but I keep adding new references and wanted to put a link to the reference library.  Despite all the reference tools I have on hand, it was not easy to find a way to do this easily. I finall…
    Creating and Managing Databases with phpMyAdmin in cPanel.
    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…

    754 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

    Need Help in Real-Time?

    Connect with top rated Experts

    24 Experts available now in Live!

    Get 1:1 Help Now