Search notes:

SAS datastep: convert between data types

Converting from a date stored as character to a numeric

data tq84_char;

  id = 1; dt = '06.11.2017'; output;
  id = 2; dt = '03.08.2014'; output;
  id = 3; dt = '18.02.2016'; output;

run;

data tq84_num;
 
  set tq84_char(rename=(dt = dt_temp));

  attrib dt format=eurdfdd10.;
  dt = input(dt_temp, ddmmyy10.);
  
  drop dt_temp;

run;


proc sql;
  describe table tq84_num;
quit;
/*
create table WORK.TQ84_NUM( bufsize=65536 )
  (
   id num,
   dt num format=EURDFDD10.
  );
*/

proc sql;
  select * from tq84_num;
quit;
Github repository about-SAS, path: /programming/data-step/set/convert/date-in-char-to-number.sas

See also

data step

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Companie...', 1759408322, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Companies-Products/SAS/programming/data-step/convert/index(74): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78