Search notes:

SAS - proc sql: expressions

case when

data tq84_nums;

  do num = 1 to 50;
     txt = put(num, words30.);
     output;
  end;

run;

proc sql;
  select
    num,
    txt,
    case
      when num = 1 then 'prime'
      when num = 2 then 'prime'
      when mod(num, 2) = 0 then 'multiple of 2'
      when mod(num, 3) = 0 then 'multiple of 3'
      when mod(num, 5) = 0 then 'multiple of 5'
      when mod(num, 7) = 0 then 'multiple of 7'
      else 'prime'
   end as is_prime
  from
   tq84_nums;
quit;
Github repository about-SAS, path: /programming/proc/sql/expressions/case-when.sas

See also

proc sql

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...', 1759415400, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Companies-Products/SAS/programming/proc/sql/expressions/index(65): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78