Hello everyone,
I'm trying to work on the dates of the file I've attached.
I would like to select the dates (the variable A) equal to 2015 (all the dates of the year 2015), but the code that I thought does not allow me to do it, where am I doing wrong?
code:
proc print data=x4;
where A=2015;
run;
Thank you all for your help.
Can you please post your log?
Here is my test
data x4;
input A (B C D Marca) (:$30.);
cards;
2015 $2.401.293 1298052 $1,85 Corona
2015 $2.240.525 1214189 $1,85 Corona
2015 $2.429.609 1361074 $1,79 Corona
2015 $2.598.085 1507040 $1,72 Corona
2015 $2.449.948 1368503 $1,79 Corona
2015 $2.399.437 1316632 $1,82 Corona
2015 $2.300.180 1239181 $1,86 Corona
2015 $2.363.694 1289863 $1,83 Corona
2015 $2.503.367 1398150 $1,79 Corona
2015 $2.869.331 1670065 $1,72 Corona
2015 $2.581.326 1414449 $1,82 Corona
2015 $2.381.142 1269756 $1,88 Corona
2015 $2.546.393 1395098 $1,83 Corona
2015 $3.143.515 1731045 $1,82 Corona
2015 $3.078.832 1702057 $1,81 Corona
2015 $3.515.778 2001541 $1,76 Corona
2015 $3.798.680 2220601 $1,71 Corona
2015 $3.907.252 2245075 $1,74 Corona
2015 $3.933.903 2138421 $1,84 Corona
2015 $3.989.391 2098149 $1,90 Corona
2015 $3.657.998 1882802 $1,94 Corona
2015 $3.752.848 1923631 $1,95 Corona
2015 $5.428.743 2880771 $1,88 Corona
2015 $5.856.748 3391333 $1,73 Corona
2015 $5.760.364 3497569 $1,65 Corona
2015 $5.620.444 3387398 $1,66 Corona
2015 $5.421.989 2924928 $1,85 Corona
2015 $5.311.350 2705189 $1,96 Corona
2015 $6.588.735 3606473 $1,83 Corona
2015 $7.154.314 3998110 $1,79 Corona
2015 $6.193.864 3392740 $1,83 Corona
2015 $6.426.027 3456459 $1,86 Corona
2015 $6.119.143 3257299 $1,88 Corona
2015 $5.056.019 2677060 $1,89 Corona
2015 $4.725.910 2445348 $1,93 Corona
2015 $4.903.411 2587641 $1,89 Corona
2015 $4.232.733 2298863 $1,84 Corona
2015 $3.780.492 1985291 $1,90 Corona
2015 $3.261.681 1670766 $1,95 Corona
2015 $3.038.481 1561400 $1,95 Corona
2015 $3.219.068 1687404 $1,91 Corona
2015 $3.228.621 1719931 $1,88 Corona
2015 $3.477.944 1991032 $1,75 Corona
2015 $3.183.484 1775932 $1,79 Corona
2015 $3.066.095 1644337 $1,86 Corona
2015 $2.874.376 1500549 $1,92 Corona
2015 $2.770.300 1474453 $1,88 Corona
2015 $2.701.548 1450353 $1,86 Corona
2015 $3.055.426 1742918 $1,75 Corona
2015 $3.130.302 1802359 $1,74 Corona
2015 $2.727.479 1463923 $1,86 Corona
2015 $2.432.938 1272290 $1,91 Corona
2016 $3.012.242 1595368 $1,89 Corona
2016 $2.482.576 1290488 $1,92 Corona
2016 $2.410.369 1239953 $1,94 Corona
2016 $2.580.602 1339683 $1,93 Corona
2016 $2.762.379 1478291 $1,87 Corona
2016 $2.752.721 1482208 $1,86 Corona
2016 $2.630.070 1372870 $1,92 Corona
2016 $2.564.244 1337283 $1,92 Corona
2016 $2.669.815 1399962 $1,91 Corona
2016 $3.060.474 1734433 $1,76 Corona
2016 $2.702.380 1439569 $1,88 Corona
2016 $3.132.119 1747713 $1,79 Corona
2016 $3.561.353 2009843 $1,77 Corona
2016 $2.894.752 1505699 $1,92 Corona
2016 $3.142.093 1665079 $1,89 Corona
2016 $3.306.338 1742239 $1,90 Corona
2016 $3.906.219 2176708 $1,79 Corona
2016 $3.297.336 1810461 $1,82 Corona
2016 $3.610.589 1969977 $1,83 Corona
2016 $3.560.401 1894616 $1,88 Corona
2016 $3.957.424 2202340 $1,80 Corona
2016 $4.554.520 2593001 $1,76 Corona
2016 $4.765.529 2757949 $1,73 Corona
2016 $5.231.766 3147870 $1,66 Corona
2016 $5.192.040 3079161 $1,69 Corona
2016 $5.770.263 3362349 $1,72 Corona
2016 $6.136.745 3408353 $1,80 Corona
2016 $6.097.780 3395471 $1,80 Corona
2016 $5.483.525 3008178 $1,82 Corona
2016 $5.366.290 2914349 $1,84 Corona
2016 $6.131.887 3549358 $1,73 Corona
2016 $6.491.191 3803071 $1,71 Corona
2016 $6.420.202 3642583 $1,76 Corona
2016 $5.292.455 3002212 $1,76 Corona
2016 $5.437.422 3110229 $1,75 Corona
2016 $5.559.884 3262123 $1,70 Corona
2016 $4.596.505 2567425 $1,79 Corona
2016 $4.030.223 2199410 $1,83 Corona
2016 $3.597.178 1978528 $1,82 Corona
2016 $4.075.848 2377707 $1,71 Corona
2016 $3.527.351 1993338 $1,77 Corona
2016 $3.168.448 1760041 $1,80 Corona
2016 $3.340.964 1888929 $1,77 Corona
2016 $2.901.417 1539794 $1,88 Corona
2016 $3.269.915 1799819 $1,82 Corona
2016 $3.034.220 1716729 $1,77 Corona
2016 $2.584.874 1356354 $1,91 Corona
2016 $2.625.575 1415839 $1,85 Corona
2016 $2.995.898 1703142 $1,76 Corona
2016 $3.136.491 1793786 $1,75 Corona
2016 $2.701.042 1505616 $1,79 Corona
2016 $2.819.784 1579564 $1,79 Corona
2017 $2.625.789 1408203 $1,86 Corona
2017 $2.399.134 1245206 $1,93 Corona
2017 $2.491.524 1324989 $1,88 Corona
2017 $2.881.621 1641332 $1,76 Corona
2017 $3.044.861 1768223 $1,72 Corona
2017 $3.036.932 1688535 $1,80 Corona
2017 $2.735.011 1441694 $1,90 Corona
2017 $2.781.392 1458877 $1,91 Corona
2017 $3.183.069 1827750 $1,74 Corona
2017 $3.555.341 2123429 $1,67 Corona
2017 $3.127.962 1747175 $1,79 Corona
2017 $2.790.520 1439912 $1,94 Corona
2017 $3.234.497 1838164 $1,76 Corona
2017 $3.696.394 2191060 $1,69 Corona
2017 $4.155.316 2610266 $1,59 Corona
2017 $5.113.312 3213180 $1,59 Corona
2017 $3.709.290 2090624 $1,77 Corona
2017 $3.912.278 2184906 $1,79 Corona
2017 $3.706.881 2172866 $1,71 Corona
2017 $4.065.499 2405640 $1,69 Corona
2017 $4.138.481 2294172 $1,80 Corona
2017 $4.257.728 2291431 $1,86 Corona
2017 $6.382.924 3939062 $1,62 Corona
2017 $6.240.262 3995014 $1,56 Corona
2017 $7.294.350 4653350 $1,57 Corona
2017 $7.057.084 4407099 $1,60 Corona
2017 $5.525.736 3189198 $1,73 Corona
2017 $5.546.290 3073447 $1,80 Corona
2017 $6.631.654 3941802 $1,68 Corona
2017 $7.106.850 4355347 $1,63 Corona
2017 $6.448.136 3818678 $1,69 Corona
2017 $6.886.320 3978290 $1,73 Corona
2017 $6.204.337 3552969 $1,75 Corona
2017 $5.791.841 3200999 $1,81 Corona
2017 $5.340.639 2971685 $1,80 Corona
2015 $2.155.272 1090862 $1,98 Tuborg
2015 $1.363.526 624393 $2,18 Tuborg
2015 $1.492.671 705672 $2,12 Tuborg
2015 $1.528.909 740464 $2,06 Tuborg
2015 $1.538.471 757202 $2,03 Tuborg
2015 $1.544.601 755264 $2,05 Tuborg
2015 $1.487.583 699648 $2,13 Tuborg
2015 $1.562.129 730270 $2,14 Tuborg
2015 $1.442.575 644945 $2,24 Tuborg
2015 $1.394.662 611540 $2,28 Tuborg
2015 $1.397.086 629224 $2,22 Tuborg
2015 $1.488.004 688054 $2,16 Tuborg
2015 $2.712.102 1562407 $1,74 Tuborg
2015 $3.137.378 1768672 $1,77 Tuborg
2015 $1.842.172 886775 $2,08 Tuborg
2015 $1.757.814 796285 $2,21 Tuborg
2015 $1.759.336 795142 $2,21 Tuborg
2015 $1.868.520 847881 $2,20 Tuborg
2015 $2.840.486 1459355 $1,95 Tuborg
2015 $3.141.496 1637119 $1,92 Tuborg
2015 $2.557.656 1313285 $1,95 Tuborg
2015 $2.748.463 1480599 $1,86 Tuborg
2015 $3.247.882 1619267 $2,01 Tuborg
2015 $2.883.739 1438540 $2,00 Tuborg
2015 $2.430.596 1178332 $2,06 Tuborg
2015 $2.469.390 1190915 $2,07 Tuborg
2015 $3.149.461 1555356 $2,02 Tuborg
2015 $3.649.731 1783248 $2,05 Tuborg
2015 $3.344.831 1523901 $2,19 Tuborg
2015 $3.314.120 1581207 $2,10 Tuborg
2015 $3.053.990 1469180 $2,08 Tuborg
2015 $3.213.789 1460611 $2,20 Tuborg
2015 $3.345.385 1511161 $2,21 Tuborg
2015 $2.599.598 1196839 $2,17 Tuborg
2015 $2.805.141 1337863 $2,10 Tuborg
2015 $2.909.112 1424664 $2,04 Tuborg
2015 $2.459.944 1200190 $2,05 Tuborg
2015 $2.695.724 1328241 $2,03 Tuborg
2015 $2.077.944 993867 $2,09 Tuborg
2015 $1.660.583 751013 $2,21 Tuborg
2015 $1.670.537 757942 $2,20 Tuborg
2015 $1.601.019 736033 $2,18 Tuborg
2015 $1.737.915 842529 $2,06 Tuborg
2015 $1.790.519 893443 $2,00 Tuborg
2015 $1.503.890 702288 $2,14 Tuborg
2015 $1.498.700 707556 $2,12 Tuborg
2015 $1.480.754 696566 $2,13 Tuborg
2015 $1.264.641 572373 $2,21 Tuborg
2015 $1.336.005 592572 $2,25 Tuborg
2015 $1.516.528 704466 $2,15 Tuborg
2015 $2.050.339 1077666 $1,90 Tuborg
2015 $1.939.660 1001945 $1,94 Tuborg
2016 $1.943.607 939433 $2,07 Tuborg
2016 $1.201.260 532518 $2,26 Tuborg
2016 $1.168.697 509991 $2,29 Tuborg
2016 $1.264.366 563919 $2,24 Tuborg
2016 $1.355.648 619399 $2,19 Tuborg
2016 $1.298.043 587923 $2,21 Tuborg
2016 $1.347.964 596244 $2,26 Tuborg
2016 $1.283.894 565578 $2,27 Tuborg
2016 $1.420.818 663514 $2,14 Tuborg
2016 $1.436.317 666493 $2,16 Tuborg
2016 $1.320.112 590274 $2,24 Tuborg
2016 $1.586.068 773270 $2,05 Tuborg
2016 $1.829.504 890710 $2,05 Tuborg
2016 $1.628.395 749472 $2,17 Tuborg
2016 $1.561.126 720765 $2,17 Tuborg
2016 $1.660.875 781275 $2,13 Tuborg
2016 $2.073.247 994128 $2,09 Tuborg
2016 $1.825.352 874817 $2,09 Tuborg
2016 $1.728.732 785860 $2,20 Tuborg
2016 $1.624.248 722068 $2,25 Tuborg
2016 $2.054.860 974325 $2,11 Tuborg
2016 $2.778.255 1422096 $1,95 Tuborg
2016 $2.481.639 1288255 $1,93 Tuborg
2016 $2.659.023 1417858 $1,88 Tuborg
2016 $2.669.855 1367567 $1,95 Tuborg
2016 $2.806.166 1415812 $1,98 Tuborg
2016 $4.033.890 2173597 $1,86 Tuborg
2016 $3.733.138 2030611 $1,84 Tuborg
2016 $3.052.201 1537601 $1,99 Tuborg
2016 $3.560.065 1843776 $1,93 Tuborg
2016 $4.372.545 2380896 $1,84 Tuborg
2016 $4.096.867 2173442 $1,88 Tuborg
2016 $3.601.563 1741705 $2,07 Tuborg
2016 $2.636.093 1219951 $2,16 Tuborg
2016 $2.747.232 1334878 $2,06 Tuborg
2016 $2.494.455 1221542 $2,04 Tuborg
2016 $2.763.387 1447812 $1,91 Tuborg
2016 $2.931.511 1569054 $1,87 Tuborg
2016 $2.366.540 1243179 $1,90 Tuborg
2016 $2.132.414 1089435 $1,96 Tuborg
2016 $1.626.335 757069 $2,15 Tuborg
2016 $1.568.693 768904 $2,04 Tuborg
2016 $2.112.701 1186360 $1,78 Tuborg
2016 $1.891.004 1022633 $1,85 Tuborg
2016 $1.566.715 741228 $2,11 Tuborg
2016 $1.524.527 737204 $2,07 Tuborg
2016 $1.714.993 857905 $2,00 Tuborg
2016 $1.650.468 807470 $2,04 Tuborg
2016 $1.622.292 802827 $2,02 Tuborg
2016 $1.848.254 957988 $1,93 Tuborg
2016 $2.018.330 1089728 $1,85 Tuborg
2016 $2.332.128 1272668 $1,83 Tuborg
2017 $2.148.771 1128670 $1,90 Tuborg
2017 $1.281.738 596078 $2,15 Tuborg
2017 $1.200.127 549076 $2,19 Tuborg
2017 $1.450.414 706334 $2,05 Tuborg
2017 $1.944.633 1033351 $1,88 Tuborg
2017 $1.945.602 1002647 $1,94 Tuborg
2017 $1.533.689 733291 $2,09 Tuborg
2017 $1.470.579 680931 $2,16 Tuborg
2017 $1.583.707 774579 $2,04 Tuborg
2017 $1.765.497 901243 $1,96 Tuborg
2017 $1.469.920 678009 $2,17 Tuborg
2017 $1.562.109 716722 $2,18 Tuborg
2017 $1.441.660 675072 $2,14 Tuborg
2017 $1.374.701 610590 $2,25 Tuborg
2017 $2.598.230 1392602 $1,87 Tuborg
2017 $3.368.839 1808532 $1,86 Tuborg
2017 $2.175.711 1071957 $2,03 Tuborg
2017 $2.796.582 1435307 $1,95 Tuborg
2017 $3.345.282 1938707 $1,73 Tuborg
2017 $3.513.071 2064541 $1,70 Tuborg
2017 $3.160.980 1716529 $1,84 Tuborg
2017 $2.962.833 1531797 $1,93 Tuborg
2017 $2.901.984 1372103 $2,11 Tuborg
2017 $2.346.532 1146437 $2,05 Tuborg
2017 $2.561.929 1227038 $2,09 Tuborg
2017 $3.485.845 1948464 $1,79 Tuborg
2017 $3.635.221 2072457 $1,75 Tuborg
2017 $4.273.455 2455249 $1,74 Tuborg
2017 $3.769.912 2008026 $1,88 Tuborg
2017 $3.010.008 1487742 $2,02 Tuborg
2017 $3.277.736 1595277 $2,05 Tuborg
2017 $4.186.227 2141289 $1,96 Tuborg
2017 $5.113.867 2973066 $1,72 Tuborg
2017 $4.926.102 2858784 $1,72 Tuborg
2017 $3.140.169 1582410 $1,98 Tuborg
;
proc print data=x4;
where A=2015;
run;
SAS Output
Student Test Scores |
2015 | $2.401.293 | 1298052 | $1,85 | Corona |
2015 | $2.240.525 | 1214189 | $1,85 | Corona |
2015 | $2.429.609 | 1361074 | $1,79 | Corona |
2015 | $2.598.085 | 1507040 | $1,72 | Corona |
2015 | $2.449.948 | 1368503 | $1,79 | Corona |
2015 | $2.399.437 | 1316632 | $1,82 | Corona |
2015 | $2.300.180 | 1239181 | $1,86 | Corona |
2015 | $2.363.694 | 1289863 | $1,83 | Corona |
2015 | $2.503.367 | 1398150 | $1,79 | Corona |
2015 | $2.869.331 | 1670065 | $1,72 | Corona |
2015 | $2.581.326 | 1414449 | $1,82 | Corona |
2015 | $2.381.142 | 1269756 | $1,88 | Corona |
2015 | $2.546.393 | 1395098 | $1,83 | Corona |
2015 | $3.143.515 | 1731045 | $1,82 | Corona |
2015 | $3.078.832 | 1702057 | $1,81 | Corona |
2015 | $3.515.778 | 2001541 | $1,76 | Corona |
2015 | $3.798.680 | 2220601 | $1,71 | Corona |
2015 | $3.907.252 | 2245075 | $1,74 | Corona |
2015 | $3.933.903 | 2138421 | $1,84 | Corona |
2015 | $3.989.391 | 2098149 | $1,90 | Corona |
2015 | $3.657.998 | 1882802 | $1,94 | Corona |
2015 | $3.752.848 | 1923631 | $1,95 | Corona |
2015 | $5.428.743 | 2880771 | $1,88 | Corona |
2015 | $5.856.748 | 3391333 | $1,73 | Corona |
2015 | $5.760.364 | 3497569 | $1,65 | Corona |
2015 | $5.620.444 | 3387398 | $1,66 | Corona |
2015 | $5.421.989 | 2924928 | $1,85 | Corona |
2015 | $5.311.350 | 2705189 | $1,96 | Corona |
2015 | $6.588.735 | 3606473 | $1,83 | Corona |
2015 | $7.154.314 | 3998110 | $1,79 | Corona |
2015 | $6.193.864 | 3392740 | $1,83 | Corona |
2015 | $6.426.027 | 3456459 | $1,86 | Corona |
2015 | $6.119.143 | 3257299 | $1,88 | Corona |
2015 | $5.056.019 | 2677060 | $1,89 | Corona |
2015 | $4.725.910 | 2445348 | $1,93 | Corona |
2015 | $4.903.411 | 2587641 | $1,89 | Corona |
2015 | $4.232.733 | 2298863 | $1,84 | Corona |
2015 | $3.780.492 | 1985291 | $1,90 | Corona |
2015 | $3.261.681 | 1670766 | $1,95 | Corona |
2015 | $3.038.481 | 1561400 | $1,95 | Corona |
2015 | $3.219.068 | 1687404 | $1,91 | Corona |
2015 | $3.228.621 | 1719931 | $1,88 | Corona |
2015 | $3.477.944 | 1991032 | $1,75 | Corona |
2015 | $3.183.484 | 1775932 | $1,79 | Corona |
2015 | $3.066.095 | 1644337 | $1,86 | Corona |
2015 | $2.874.376 | 1500549 | $1,92 | Corona |
2015 | $2.770.300 | 1474453 | $1,88 | Corona |
2015 | $2.701.548 | 1450353 | $1,86 | Corona |
2015 | $3.055.426 | 1742918 | $1,75 | Corona |
2015 | $3.130.302 | 1802359 | $1,74 | Corona |
2015 | $2.727.479 | 1463923 | $1,86 | Corona |
2015 | $2.432.938 | 1272290 | $1,91 | Corona |
2015 | $2.155.272 | 1090862 | $1,98 | Tuborg |
2015 | $1.363.526 | 624393 | $2,18 | Tuborg |
2015 | $1.492.671 | 705672 | $2,12 | Tuborg |
2015 | $1.528.909 | 740464 | $2,06 | Tuborg |
2015 | $1.538.471 | 757202 | $2,03 | Tuborg |
2015 | $1.544.601 | 755264 | $2,05 | Tuborg |
2015 | $1.487.583 | 699648 | $2,13 | Tuborg |
2015 | $1.562.129 | 730270 | $2,14 | Tuborg |
2015 | $1.442.575 | 644945 | $2,24 | Tuborg |
2015 | $1.394.662 | 611540 | $2,28 | Tuborg |
2015 | $1.397.086 | 629224 | $2,22 | Tuborg |
2015 | $1.488.004 | 688054 | $2,16 | Tuborg |
2015 | $2.712.102 | 1562407 | $1,74 | Tuborg |
2015 | $3.137.378 | 1768672 | $1,77 | Tuborg |
2015 | $1.842.172 | 886775 | $2,08 | Tuborg |
2015 | $1.757.814 | 796285 | $2,21 | Tuborg |
2015 | $1.759.336 | 795142 | $2,21 | Tuborg |
2015 | $1.868.520 | 847881 | $2,20 | Tuborg |
2015 | $2.840.486 | 1459355 | $1,95 | Tuborg |
2015 | $3.141.496 | 1637119 | $1,92 | Tuborg |
2015 | $2.557.656 | 1313285 | $1,95 | Tuborg |
2015 | $2.748.463 | 1480599 | $1,86 | Tuborg |
2015 | $3.247.882 | 1619267 | $2,01 | Tuborg |
2015 | $2.883.739 | 1438540 | $2,00 | Tuborg |
2015 | $2.430.596 | 1178332 | $2,06 | Tuborg |
2015 | $2.469.390 | 1190915 | $2,07 | Tuborg |
2015 | $3.149.461 | 1555356 | $2,02 | Tuborg |
2015 | $3.649.731 | 1783248 | $2,05 | Tuborg |
2015 | $3.344.831 | 1523901 | $2,19 | Tuborg |
2015 | $3.314.120 | 1581207 | $2,10 | Tuborg |
2015 | $3.053.990 | 1469180 | $2,08 | Tuborg |
2015 | $3.213.789 | 1460611 | $2,20 | Tuborg |
2015 | $3.345.385 | 1511161 | $2,21 | Tuborg |
2015 | $2.599.598 | 1196839 | $2,17 | Tuborg |
2015 | $2.805.141 | 1337863 | $2,10 | Tuborg |
2015 | $2.909.112 | 1424664 | $2,04 | Tuborg |
2015 | $2.459.944 | 1200190 | $2,05 | Tuborg |
2015 | $2.695.724 | 1328241 | $2,03 | Tuborg |
2015 | $2.077.944 | 993867 | $2,09 | Tuborg |
2015 | $1.660.583 | 751013 | $2,21 | Tuborg |
2015 | $1.670.537 | 757942 | $2,20 | Tuborg |
2015 | $1.601.019 | 736033 | $2,18 | Tuborg |
2015 | $1.737.915 | 842529 | $2,06 | Tuborg |
2015 | $1.790.519 | 893443 | $2,00 | Tuborg |
2015 | $1.503.890 | 702288 | $2,14 | Tuborg |
2015 | $1.498.700 | 707556 | $2,12 | Tuborg |
2015 | $1.480.754 | 696566 | $2,13 | Tuborg |
2015 | $1.264.641 | 572373 | $2,21 | Tuborg |
2015 | $1.336.005 | 592572 | $2,25 | Tuborg |
2015 | $1.516.528 | 704466 | $2,15 | Tuborg |
2015 | $2.050.339 | 1077666 | $1,90 | Tuborg |
2015 | $1.939.660 | 1001945 | $1,94 | Tuborg |
but the code that I thought does not allow me to do it, where am I doing wrong?
What does that mean? Do you get an error? It's possible it read it in as a character then you'd need quotes.
But without the log, we can just guess...
If you're getting errors please post the log.
@umberto wrote:
Hello everyone,
I'm trying to work on the dates of the file I've attached.
I would like to select the dates (the variable A) equal to 2015 (all the dates of the year 2015), but the code that I thought does not allow me to do it, where am I doing wrong?
code:
proc print data=x4; where A=2015; run;
Thank you all for your help.
Try this:
data x4;
input A 4. (B C D Marca) (:$30.);
cards;
Do you actually have values like 2015 in the data? If so then your code should work.
Or do you have actual date values?
If the later then you could use the YEAR() function to test if the date is in a particular year.
where year(A) = 2015 ;
Or if you have a datetime value you will need to get the date part first.
where year(datepart(A)) = 2015;
If you have a character variable instead then you will need use a string literal in your WHERE clause. Put watch out for leading spaces in your character variable. ' 2015' might look like '2015' when printed but will not match. The STRIP() or LEFT() function will remove leading spaces.
where strip(year)= '2015';
I thank all of the availability, forgive my imprecision (I'm a beginner);
using where year (A) = 2015; the problem has been solved;
if I understood correctly the obstacle was due to the fact that 2015 was a format, while the value saved by Sas was a date? so the date that appeared (2015,2016 and 2017) was only displayed as such, but saved with another value?
@umberto wrote:
I thank all of the availability, forgive my imprecision (I'm a beginner);
using where year (A) = 2015; the problem has been solved;
if I understood correctly the obstacle was due to the fact that 2015 was a format, while the value saved by Sas was a date? so the date that appeared (2015,2016 and 2017) was only displayed as such, but saved with another value?
If that solved the problem then the value was stored as a SAS date value. SAS date values are the number of days from 1 Jan 1960. The desired format then displays in a more human readable form and allows a wide variety of appearance options without having to add variables. The format can be used to create groups based on the format, such as year. or yyq or monname. or .. With Proc Format you can create custom Date (or time or datetime) displays as well.
Note that Time and Datetime values are the number of seconds.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.