data zb_1; input x y$; cards; 1.1 A 1.2 B 1.3 C 1.4 D ; run; data zb_2; input x y$; cards; 2.1 A 2.2 B 2.3 C 2.4 D ; run; data boys(where=(sex='M')) girls(where=(sex='F')); set sashelp.class; run; data dwa; set zb_1 zb_2; run; data zb_3; input t k$; cards; 2.1 A 2.2 B 2.3 C 2.4 D ; run; data dwa; set zb_1 zb_3; run; data test; length zm 3 zm_2 $10; run; data zb_4; input t y $; cards; 2.1 A 2.2 B 2.3 C 2.4 D ; run; data dwa; set zb_1 zb_4; run; data dwa; set zb_1 zb_2; by y; run; /* do testowania */ data pyt1 set zb_1; set zb_2; run; /* do testowania */ data pyt2 set zb_1(rename=(x=t)); set zb_2; run; data a; x1=1; x2=4; x4=54; y6=10; y8=12; y9=0.5; format x1-x4 words.; format y6-y8 roman.; format y9 2.; run; data a; x1=1; y6=10; y8=12; x2=4; x3=54; y9=0.5; *format x1-x4 words.; *format y6-y8 roman.; *format y9 2.; run; data b; set a(keep=x1-x3); sum = sum(of x1-x3); run; data a; input id name $ x y z; cards; 1 Zosia 2 3 4 2 Ania 3 4 6 ; run; data b; set a(keep=x--z); run; data b; set a(keep=name--z); run; data b; set a(keep=id-numeric-z); run; data a; x_a=1; x_b=3; x_c=2; yxz=0; output; x_a=5; x_b=2; x_c=6; yxz=8; output; run; data b; set a(keep=x:); z = sum(of x:); run; /* ELEMENTY PROGRAMISTYCZNE */ /* IF warunek THEN instrukcja; ; */ data a; set sashelp.class; if age > 14; run; data a; set sashelp.cars; if enginesize >3 then test=1; else test=0; run; proc print data=a; title 'Warunek if'; by make; var make model type ; footnote "Utworzono &systime &sysday, &sysdate9"; run; /* petla */ /* do to end do zmienna=start to stop ; instrukcje; end; */ data lasowe; do x=1 to 10 by 2; y = rand('NORMAL'); output; end; run; /* DO WHILE END ; DO While(warunek); instrukcje; end; */ data _null_; n=0; do while(n<10); put n=; n+1; end; run; /* DO UNTIL */ data _null_; n=0; do until(n<10); put n=; n+1; end; run; data losowe; do x=1 to 100 by 1; *until(y>0.7); y=rand('UNIForm'); output; end; run; data inwestycje; rok=2010; do while(rok