/* day 3, pgm 3.4 */ /* */ /* examples of variable lists and */ /* some operators */ data logical; input x1 VA $ x3 VB $ x2 VC $; /*** Note order ***/ logic1 = (x1>7)|(x3=4); * or -- try with letters ; logic2 = ((x1>5)&(x2<10))*3; * and with arithmetic ; cards; 1 x 2 xy 3 xyz 4 w 5 wx 6 wxy 7 v 8 vw 9 vwx 9 x 8 xxx 7 zzzz ; run ; /* print out five different ways */ proc print data=logical ; title 'full data'; run ; proc print data=logical ; var x1-x3; * simple variable list ; title2 'var x1-x3'; * note title2 ; run ; proc print data=logical ; var x1--x3; * all variables between x1 and x3 ; title2 'var x1--x3'; * second title again ; run ; proc print data=logical ; var VA-numeric-VB; * numeric variables between VA and VB ; title2 'var VA-numeric-VB'; run ; proc print data=logical ; var _numeric_; * numeric variables ; title2 'var _numeric_'; run;