Search notes:

SAS macro: boolean representation

true: 1 / false: 0

A true value is represented by a 1, a false value by a 0.
%macro tq84_put_condition(expr);
   %put &expr : %eval(&expr);
%mend  tq84_put_condition;

%tq84_put_condition(4 < 10); /* 4 < 10 : 1 */
%tq84_put_condition(4 > 10); /* 4 > 10 : 0 */
Github repository about-SAS, path: /macro-processor/bool/condition.sas

Expressions

%macro tq84_bool(expr);

  %if &expr
  %then %put >&expr< is true;
  %else %put >&expr< is false;

%mend tq84_bool;


%tq84_bool(        0    );   /*  >0< is false         */
%tq84_bool(        1    );   /*  >1< is true          */
%tq84_bool(        1-1  );   /*  >1-1< is false       */
%tq84_bool(        1+1  );   /*  >1+1< is true        */
%tq84_bool(%nrstr(  0  ));   /*  >  0  < is false     */
%tq84_bool(%nrstr(  1  ));   /*  >  1  < is true      */
%tq84_bool(  abc > def  );   /*  >abc > def< is false */
%tq84_bool(  abc eq abc );   /*  >abc eq abc< is true */
Github repository about-SAS, path: /macro-processor/bool/expression.sas

See also

macros

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