Import date and time within one colum e.g. 1.1.1999 01:00:23

Discussion in 'SAS (Statistical Analysis Software)' started by Jarg, Mar 2, 2005.

  1. Jarg

    Jarg Guest


    Does anybody know how to import the following date colum as an sas
    date and time value? The original data is delimited by ";".

    1.1.1999 01:00:23
    10.10.2003 21:23:01

    Thanks a lot in advance!

    Jarg, Mar 2, 2005
    1. Advertisements

  2. Jarg

    shiling99 Guest

    I think the ready to use informat for your problem is not available
    yet. But you always can .......


    data _null_;
    length timec $20;
    infile cards;
    input timec 1-20;
    date=input(scan(timec,1,' '),ddmmyy10.);
    time=input(scan(timec,2,' '),time9.);

    put date= ddmmyy10. time= time8. datetime= datetime20. ;;
    1.1.1999 01:00:23
    10.10.2003 21:23:01
    shiling99, Mar 3, 2005
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.