Help using Base SAS procedures

Writing current date and time with PROCSQL;

Reply
Contributor
Posts: 60

Writing current date and time with PROCSQL;

Hi,

I need to write current sysdate and systime with PROC SQL. How should I format dates to fit DATETIME19.2 format in table?

Super Contributor
Posts: 1,636

Writing current date and time with PROCSQL;

Is this what you want?

data have;

  input id age;

  cards;

  1 20

  2 30

  ;

run;

proc sql;

  select *,datetime() format=datetime19.2 as time

    from have;

quit;

Ask a Question
Discussion stats
  • 1 reply
  • 4473 views
  • 0 likes
  • 2 in conversation