Hi Folks!
I recently found free SAS Studio and am now using SAS again after 4 years away from having access!
I added my code into the program then copied in my data set and used Proc Print to test if the data comes through before using other Procs.
Thank you to anyone who takes this one on! It seems to be an issue with the SAS Studio that I never had issue with on a desktop version.
Running the program gave me a lot of these: "NOTE: Invalid data for year in line 75 1-115." for many different lines.
1. First, here is my code:
options ls=150 ps=80;
data SScont;
input year rep nrate tp tk tca tmg ts tfe tmn tzn tcu;
cards;
2009 2 0 17.31847074 70.2626097 8.417048394 6.734482969 3.700073168 452.9787871 76.01810422 148.4861971 19.71026264
2009 3 0 10.99864565 53.30676542 8.210661534 5.785180889 4.113729417 135.2121476 77.21748144 126.5724259 13.88752562
2009 4 0 15.60271095 100.0896276 16.19599563 15.37879439 7.282917703 505.5302851 261.2628173 191.7346993 43.53840606
2009 1 0 16.65288975 97.29576904 11.08789039 10.68153677 6.923796632 304.1101348 457.2981062 276.5951896 27.79592896
2009 2 0 12.14223468 46.34101307 5.405333144 5.13346856 3.487627818 169.743601 74.82774341 103.3780219 19.07940953
2009 3 0 15.82913881 83.11154817 10.63141032 8.847957051 3.767754241 437.4550893 56.03477618 220.3478937 24.34993967
2009 4 0 8.900479934 68.04791106 11.99831096 11.4840733 3.640000096 339.9594832 175.1659218 128.7668098 39.07438612
2009 1 50 15.06690326 64.37186544 7.020654569 7.38383079 3.403774393 684.9998263 138.611227 185.6130733 22.84513706
2009 2 50 16.22239432 76.60183503 9.011698364 8.025858515 4.298272606 383.9924324 116.8829353 158.7193354 32.44234549
2009 3 50 . . . . . . . . .
2009 4 50 11.66098665 84.48371656 14.3782228 14.09393205 7.122866668 267.2143139 400.1753818 142.7030684 27.71415246
2009 1 50 15.23842028 81.59232015 9.422767655 8.554461178 6.525354361 297.1875195 291.183362 181.5078054 25.29085093
2009 2 50 16.90049645 73.3832778 11.53943809 10.7765126 6.122028852 198.2920021 234.8992982 148.5604071 24.00987855
2009 3 50 17.30499379 75.33014499 8.759196398 8.182733521 4.163198184 331.3876362 67.89253989 284.2384245 30.23699468
2009 4 50 . . . . . . . . .
2009 1 100 10.65722804 58.77764946 10.42390498 10.88817122 4.073565268 487.2298963 167.9104985 135.9002776 25.67570655
2009 2 100 12.41121845 60.62850625 6.073333425 5.452686719 2.61996532 346.0494199 52.22044458 132.6253039 22.22142899
2009 3 100 10.81889995 63.43014645 11.51087334 11.00763378 4.722297256 402.1632665 25.65806712 157.3104976 23.14301135
2009 4 100 15.95382867 116.7742194 21.82204872 21.08347825 8.627366931 1182.628095 80.07876395 254.183 40.96185378
2009 1 100 11.16706957 67.48451003 14.24170803 14.62581557 7.357059844 336.5285587 374.3575559 178.7828257 28.26802855
2009 2 100 15.17873837 53.95200776 8.920949328 7.503432782 3.665155119 266.5593277 93.51316308 173.6009841 19.24046567
2009 3 100 16.07913684 103.9921125 18.86055944 19.93727089 5.920947487 737.9688187 264.9280403 228.6183804 54.77679023
2009 4 100 18.21484258 145.2042277 15.93300332 15.63323637 6.295949515 844.2610016 200.1829065 319.8121948 33.15170536
2009 1 150 12.94258009 60.81533132 9.278374401 8.746565655 2.697618558 400.1608435 77.18041197 158.5628797 22.27840507
2009 2 150 13.90291073 72.69817897 9.215761442 8.545335337 3.358327771 366.0288997 136.1867274 106.2180071 25.21317725
2009 3 150 11.14665129 81.80158069 13.39947397 14.9844905 5.373056828 387.6889368 287.301147 186.8213512 45.94006072
2009 4 150 10.76396631 95.2632504 36.45939672 31.58852425 8.715424616 801.2853693 386.1106965 284.8469574 81.19771716
2009 1 150 15.65981139 78.82217517 12.67163451 12.13309909 6.585733864 249.8565339 213.8531791 196.4774834 26.515004
2009 2 150 16.40974286 99.68174288 21.60148046 19.0264916 8.48183946 334.805911 316.9710717 119.7088709 41.09379991
2009 3 150 9.641901245 110.5933192 15.57019412 18.48799612 4.547168951 979.8840669 86.52092865 256.6957969 52.86711034
2009 4 150 23.55546016 136.2397272 25.23529139 22.0366955 6.630161624 1146.247654 164.934071 415.1641735 47.47602146
2009 1 200 12.78041659 53.72772343 11.34379016 10.96845961 2.677565897 459.5557375 92.70399721 193.4934352 34.13704327
2009 2 200 9.490275333 102.205873 11.74463451 15.10870444 3.937438513 529.2234588 88.38217614 209.5634701 42.33683886
2009 3 200 8.636065928 85.89693613 20.0358709 21.82202409 7.38017573 433.6890867 116.4399435 269.7532193 66.70735152
2009 4 200 13.09315412 103.2156607 28.65763418 26.70717156 9.913034311 434.6859166 497.0688963 221.8096473 75.68512917
2009 1 200 21.25238117 119.8455298 20.70134414 22.26680131 11.34585488 529.13832 448.0416877 350.4356564 74.91156923
2009 2 200 21.05554286 133.877391 22.81962901 22.48790841 10.49346363 884.6127618 320.5323254 243.9661233 53.36306195
2009 3 200 13.31821882 83.33917619 20.13137336 21.56923806 5.511534948 764.1437813 266.3053845 179.0886664 52.52822117
2009 4 200 15.92788435 108.187261 14.53012983 16.03226727 6.288120557 417.4854977 242.6216791 185.2870857 39.38171664
2010 1 0 27.97652334 123.6107878 15.78182846 13.82899935 7.447690678 771.2563015 308.156919 275.6090827 27.92759468
2010 2 0 . . . . . . . . .
2010 3 0 28.75588845 127.0866906 20.7922202 13.32251031 6.700895875 694.4815235 141.1975872 293.2448258 18.75642257
2010 4 0 24.35093517 124.1006617 19.86053021 13.41000712 7.063051843 607.4967834 193.6587115 212.306566 22.62350939
2010 1 0 18.18097766 110.6357748 15.8864816 11.0942119 7.842969683 322.6278325 570.0637507 209.0421298 18.24601774
2010 2 0 50.57393337 260.6042463 33.142102 22.24610968 14.64993011 599.6456501 402.6635394 368.0624611 34.93510173
2010 3 0 43.63298344 256.6232635 39.2336582 23.36183785 11.96854061 642.3575202 287.8941402 421.9790689 33.90687608
2010 4 0 25.14145166 135.7259566 30.1959054 18.38202071 9.828554086 449.4676623 261.8462061 230.8289643 27.97526266
2010 1 50 36.81203289 125.9394 28.24453421 23.12731974 9.562274211 539.1926842 486.1233039 344.6847355 34.83284132
2010 2 50 . . . . . . . . .
2010 3 50 27.83875346 101.830029 30.71017209 21.20377098 7.500850423 877.6069458 423.7781966 177.6926184 45.22102762
2010 4 50 23.10412042 112.712192 20.68125433 16.98503092 6.568176793 655.2341962 318.2147612 209.4838349 18.18620473
2010 1 50 38.86314555 158.2448756 35.44937698 26.11528425 13.86798281 465.2011687 615.862353 328.409687 34.55425234
2010 2 50 42.579125 167.0991382 40.31061053 27.56498947 13.11406257 337.7963487 482.719875 350.1678816 35.31890592
2010 3 50 49.32475455 217.5846794 38.86560287 28.94319024 14.82419373 677.9356383 393.4476656 324.3710875 35.47621869
2010 4 50 24.83776843 131.9147806 32.41025077 26.93554775 10.77355455 681.5653405 452.9142137 229.5942816 27.89298581
2010 1 100 7.600481163 44.03339834 32.0459205 22.11876482 9.016353934 418.8459801 524.9182803 120.9237438 42.36574172
2010 2 100 29.41985418 166.5107165 36.44475724 29.99917341 9.385255069 1189.278919 323.9652499 279.4376262 50.05776028
2010 3 100 25.99876449 134.4230582 45.79061684 32.95909278 10.75479413 1202.208824 497.6942571 232.0368952 62.81824075
2010 4 100 45.01233924 193.4134648 44.00903874 24.98222096 11.28449288 1286.912239 214.9778945 471.677456 46.35958317
2010 1 100 19.75620711 90.91830698 32.17766066 22.65911124 8.800738338 983.8128202 572.1391186 228.4610316 36.0998782
2010 2 100 . . . . . . . . .
2010 3 100 40.23695125 160.1708763 56.84114851 43.95425939 15.97703292 844.9377311 165.3848988 395.9448701 70.71768058
2010 4 100 39.49541338 165.2380254 72.94705855 61.48610855 19.78580471 1694.923377 375.0076342 452.7027246 112.6320248
2010 1 150 29.17391059 146.0596519 41.35851502 27.39513568 8.585319357 1217.58392 356.4985655 215.2392336 52.84359265
2010 2 150 42.14781867 182.3086467 38.09205919 27.21455808 11.50227113 705.5620629 513.7144775 149.8433957 42.07550545
2010 3 150 21.61727306 100.8455303 23.58177918 17.68317749 5.770053086 1003.787448 108.0922011 181.4767418 32.98945888
2010 4 150 26.27365395 102.0839736 48.21905949 32.20168012 10.92664755 1549.968598 689.5147022 179.8790506 45.38471284
2010 1 150 90.12198767 335.6557951 61.93483366 45.13260277 26.58231555 1208.749914 557.3646811 559.544315 112.6826941
2010 2 150 40.63578486 199.6412647 55.45121722 42.56902633 17.8703193 1426.62465 625.8871843 345.8600943 93.60553302
2010 3 150 . . . . . . . . .
2010 4 150 13.81444854 76.18666617 53.30081006 32.99333425 11.50771322 1226.181339 356.1319753 227.1075861 64.67249475
2010 1 200 36.24187656 161.3639617 68.31395969 54.13519856 19.15386593 1287.219124 1089.357562 445.32061 126.4852115
2010 2 200 18.05426528 108.757744 30.18998264 25.53895939 9.528298046 759.3003967 428.8460008 330.3701127 55.08366035
2010 3 200 19.2011212 151.3570521 25.76220698 20.23923355 7.321530288 694.3277201 417.8765815 311.0709451 35.41433768
2010 4 200 22.37841439 76.89907042 28.57904018 23.09799402 7.450518114 704.5447576 513.0263221 193.8008006 31.14502682
2010 1 200 34.26068639 144.1316132 41.46088563 30.75559695 10.36991 1043.554005 322.9054144 312.2046033 68.34812871
2010 2 200 33.55711355 188.4639213 36.71040355 30.28894566 12.49590105 1366.219169 624.8784468 348.7630316 65.83708884
2010 3 200 21.51488004 150.5480152 33.46114888 30.24339775 11.79458403 994.2632311 272.8587974 303.3570693 56.29491959
2010 4 200 16.37368621 79.64312733 42.47335618 30.68214211 11.18654681 586.7087488 681.229829 179.77403 47.36361763
;
proc print
2. Now here is my log:
Hi @mmaw, welcome to the SAS Support Communities and welcome back to SAS programming :-)!
It seems that your post has been overlooked ...
@mmaw wrote:
(...)
I added my code into the program then copied in my data set ...
(...) It seems to be an issue with the SAS Studio that I never had issue with on a desktop version.
The issue is that the source from where you copied your data used tab characters (hexadecimal ASCII code 09) as delimiters*, not ordinary blanks (hex 20). So, you copied tabs into your data lines and, unlike your former desktop version of SAS, SAS Studio does not treat these as blanks. Instead, SAS tries to read the long strings consisting of digits, tabs and decimal points (the whole records!) into your numeric variables because the "list INPUT" that you are using expects blanks as delimiters, hence the "Invalid data" notes.
I don't use SAS Studio, but as a quick fix it should help to insert an INFILE statement with the EXPANDTABS option (or with the DLM option: dlm='09'x) before your INPUT statement:
data SScont; infile cards expandtabs; input year rep nrate tp tk tca tmg ts tfe tmn tzn tcu; ...
Another option is to replace the tab characters with blanks in the program editor. (In the desktop version of SAS there is a checkbox "Regular expression search" in the Replace dialog and you can enter \t in the "Find text" field to specify the tab character. I don't know if the program editor in SAS Studio has a similar feature.)
Also, you wouldn't normally copy raw data from external sources (text files, Excel spreadsheets, etc.) into the program editor in order to read them, but you would read them directly.
* This can be seen from the hex codes of your data lines printed in the log:
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0 86 CHAR 2009.1.50.15.23842028.81.59232015.9.422767655.8.554461178.6.525354361.297.1875195.291.183362.181.507 ZONE 3333030330332333333330332333333330323333333330323333333330323333333330333233333330333233333303332333 NUMR 200991950915E23842028981E5923201599E42276765598E55446117896E5253543619297E18751959291E1833629181E507
(Note that I used the "Insert code" button with the </> icon to paste lines from your log so as to preserve indentation and to use a fixed-width font.)
Hi @mmaw, welcome to the SAS Support Communities and welcome back to SAS programming :-)!
It seems that your post has been overlooked ...
@mmaw wrote:
(...)
I added my code into the program then copied in my data set ...
(...) It seems to be an issue with the SAS Studio that I never had issue with on a desktop version.
The issue is that the source from where you copied your data used tab characters (hexadecimal ASCII code 09) as delimiters*, not ordinary blanks (hex 20). So, you copied tabs into your data lines and, unlike your former desktop version of SAS, SAS Studio does not treat these as blanks. Instead, SAS tries to read the long strings consisting of digits, tabs and decimal points (the whole records!) into your numeric variables because the "list INPUT" that you are using expects blanks as delimiters, hence the "Invalid data" notes.
I don't use SAS Studio, but as a quick fix it should help to insert an INFILE statement with the EXPANDTABS option (or with the DLM option: dlm='09'x) before your INPUT statement:
data SScont; infile cards expandtabs; input year rep nrate tp tk tca tmg ts tfe tmn tzn tcu; ...
Another option is to replace the tab characters with blanks in the program editor. (In the desktop version of SAS there is a checkbox "Regular expression search" in the Replace dialog and you can enter \t in the "Find text" field to specify the tab character. I don't know if the program editor in SAS Studio has a similar feature.)
Also, you wouldn't normally copy raw data from external sources (text files, Excel spreadsheets, etc.) into the program editor in order to read them, but you would read them directly.
* This can be seen from the hex codes of your data lines printed in the log:
RULE: ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0 86 CHAR 2009.1.50.15.23842028.81.59232015.9.422767655.8.554461178.6.525354361.297.1875195.291.183362.181.507 ZONE 3333030330332333333330332333333330323333333330323333333330323333333330333233333330333233333303332333 NUMR 200991950915E23842028981E5923201599E42276765598E55446117896E5253543619297E18751959291E1833629181E507
(Note that I used the "Insert code" button with the </> icon to paste lines from your log so as to preserve indentation and to use a fixed-width font.)
@FreelanceReinh Thank you for this helpful correction to the code. Yes, coming back to SAS is a familiar friendly nemesis...!
I realized with a few hours of internet scouring that this was the issue, but I could not figure out a way to solve it. So, again, thank you!
But we still have an error...
Here is my current code:
options ls=150 ps=80; data SScont; infile cards expandtabs; input year rep nrate tp tk tca tmg ts tfe tmn tzn tcu; 2009 1 0 . . . . . . . . . 2009 2 0 17.31847074 70.2626097 8.417048394 6.734482969 3.700073168 452.9787871 76.01810422 148.4861971 19.71026264 2009 3 0 10.99864565 53.30676542 8.210661534 5.785180889 4.113729417 135.2121476 77.21748144 126.5724259 13.88752562 2009 4 0 15.60271095 100.0896276 16.19599563 15.37879439 7.282917703 505.5302851 261.2628173 191.7346993 43.53840606 2009 1 0 16.65288975 97.29576904 11.08789039 10.68153677 6.923796632 304.1101348 457.2981062 276.5951896 27.79592896 2009 2 0 12.14223468 46.34101307 5.405333144 5.13346856 3.487627818 169.743601 74.82774341 103.3780219 19.07940953 2009 3 0 15.82913881 83.11154817 10.63141032 8.847957051 3.767754241 437.4550893 56.03477618 220.3478937 24.34993967 2009 4 0 8.900479934 68.04791106 11.99831096 11.4840733 3.640000096 339.9594832 175.1659218 128.7668098 39.07438612 2009 1 50 15.06690326 64.37186544 7.020654569 7.38383079 3.403774393 684.9998263 138.611227 185.6130733 22.84513706 2009 2 50 16.22239432 76.60183503 9.011698364 8.025858515 4.298272606 383.9924324 116.8829353 158.7193354 32.44234549 2009 3 50 . . . . . . . . . 2009 4 50 11.66098665 84.48371656 14.3782228 14.09393205 7.122866668 267.2143139 400.1753818 142.7030684 27.71415246 2009 1 50 15.23842028 81.59232015 9.422767655 8.554461178 6.525354361 297.1875195 291.183362 181.5078054 25.29085093 2009 2 50 16.90049645 73.3832778 11.53943809 10.7765126 6.122028852 198.2920021 234.8992982 148.5604071 24.00987855 2009 3 50 17.30499379 75.33014499 8.759196398 8.182733521 4.163198184 331.3876362 67.89253989 284.2384245 30.23699468 2009 4 50 . . . . . . . . . 2009 1 100 10.65722804 58.77764946 10.42390498 10.88817122 4.073565268 487.2298963 167.9104985 135.9002776 25.67570655 2009 2 100 12.41121845 60.62850625 6.073333425 5.452686719 2.61996532 346.0494199 52.22044458 132.6253039 22.22142899 2009 3 100 10.81889995 63.43014645 11.51087334 11.00763378 4.722297256 402.1632665 25.65806712 157.3104976 23.14301135 2009 4 100 15.95382867 116.7742194 21.82204872 21.08347825 8.627366931 1182.628095 80.07876395 254.183 40.96185378 2009 1 100 11.16706957 67.48451003 14.24170803 14.62581557 7.357059844 336.5285587 374.3575559 178.7828257 28.26802855 2009 2 100 15.17873837 53.95200776 8.920949328 7.503432782 3.665155119 266.5593277 93.51316308 173.6009841 19.24046567 2009 3 100 16.07913684 103.9921125 18.86055944 19.93727089 5.920947487 737.9688187 264.9280403 228.6183804 54.77679023 2009 4 100 18.21484258 145.2042277 15.93300332 15.63323637 6.295949515 844.2610016 200.1829065 319.8121948 33.15170536 2009 1 150 12.94258009 60.81533132 9.278374401 8.746565655 2.697618558 400.1608435 77.18041197 158.5628797 22.27840507 2009 2 150 13.90291073 72.69817897 9.215761442 8.545335337 3.358327771 366.0288997 136.1867274 106.2180071 25.21317725 2009 3 150 11.14665129 81.80158069 13.39947397 14.9844905 5.373056828 387.6889368 287.301147 186.8213512 45.94006072 2009 4 150 10.76396631 95.2632504 36.45939672 31.58852425 8.715424616 801.2853693 386.1106965 284.8469574 81.19771716 2009 1 150 15.65981139 78.82217517 12.67163451 12.13309909 6.585733864 249.8565339 213.8531791 196.4774834 26.515004 2009 2 150 16.40974286 99.68174288 21.60148046 19.0264916 8.48183946 334.805911 316.9710717 119.7088709 41.09379991 2009 3 150 9.641901245 110.5933192 15.57019412 18.48799612 4.547168951 979.8840669 86.52092865 256.6957969 52.86711034 2009 4 150 23.55546016 136.2397272 25.23529139 22.0366955 6.630161624 1146.247654 164.934071 415.1641735 47.47602146 2009 1 200 12.78041659 53.72772343 11.34379016 10.96845961 2.677565897 459.5557375 92.70399721 193.4934352 34.13704327 2009 2 200 9.490275333 102.205873 11.74463451 15.10870444 3.937438513 529.2234588 88.38217614 209.5634701 42.33683886 2009 3 200 8.636065928 85.89693613 20.0358709 21.82202409 7.38017573 433.6890867 116.4399435 269.7532193 66.70735152 2009 4 200 13.09315412 103.2156607 28.65763418 26.70717156 9.913034311 434.6859166 497.0688963 221.8096473 75.68512917 2009 1 200 21.25238117 119.8455298 20.70134414 22.26680131 11.34585488 529.13832 448.0416877 350.4356564 74.91156923 2009 2 200 21.05554286 133.877391 22.81962901 22.48790841 10.49346363 884.6127618 320.5323254 243.9661233 53.36306195 2009 3 200 13.31821882 83.33917619 20.13137336 21.56923806 5.511534948 764.1437813 266.3053845 179.0886664 52.52822117 2009 4 200 15.92788435 108.187261 14.53012983 16.03226727 6.288120557 417.4854977 242.6216791 185.2870857 39.38171664 2010 1 0 27.97652334 123.6107878 15.78182846 13.82899935 7.447690678 771.2563015 308.156919 275.6090827 27.92759468 2010 2 0 . . . . . . . . . 2010 3 0 28.75588845 127.0866906 20.7922202 13.32251031 6.700895875 694.4815235 141.1975872 293.2448258 18.75642257 2010 4 0 24.35093517 124.1006617 19.86053021 13.41000712 7.063051843 607.4967834 193.6587115 212.306566 22.62350939 2010 1 0 18.18097766 110.6357748 15.8864816 11.0942119 7.842969683 322.6278325 570.0637507 209.0421298 18.24601774 2010 2 0 50.57393337 260.6042463 33.142102 22.24610968 14.64993011 599.6456501 402.6635394 368.0624611 34.93510173 2010 3 0 43.63298344 256.6232635 39.2336582 23.36183785 11.96854061 642.3575202 287.8941402 421.9790689 33.90687608 2010 4 0 25.14145166 135.7259566 30.1959054 18.38202071 9.828554086 449.4676623 261.8462061 230.8289643 27.97526266 2010 1 50 36.81203289 125.9394 28.24453421 23.12731974 9.562274211 539.1926842 486.1233039 344.6847355 34.83284132 2010 2 50 . . . . . . . . . 2010 3 50 27.83875346 101.830029 30.71017209 21.20377098 7.500850423 877.6069458 423.7781966 177.6926184 45.22102762 2010 4 50 23.10412042 112.712192 20.68125433 16.98503092 6.568176793 655.2341962 318.2147612 209.4838349 18.18620473 2010 1 50 38.86314555 158.2448756 35.44937698 26.11528425 13.86798281 465.2011687 615.862353 328.409687 34.55425234 2010 2 50 42.579125 167.0991382 40.31061053 27.56498947 13.11406257 337.7963487 482.719875 350.1678816 35.31890592 2010 3 50 49.32475455 217.5846794 38.86560287 28.94319024 14.82419373 677.9356383 393.4476656 324.3710875 35.47621869 2010 4 50 24.83776843 131.9147806 32.41025077 26.93554775 10.77355455 681.5653405 452.9142137 229.5942816 27.89298581 2010 1 100 7.600481163 44.03339834 32.0459205 22.11876482 9.016353934 418.8459801 524.9182803 120.9237438 42.36574172 2010 2 100 29.41985418 166.5107165 36.44475724 29.99917341 9.385255069 1189.278919 323.9652499 279.4376262 50.05776028 2010 3 100 25.99876449 134.4230582 45.79061684 32.95909278 10.75479413 1202.208824 497.6942571 232.0368952 62.81824075 2010 4 100 45.01233924 193.4134648 44.00903874 24.98222096 11.28449288 1286.912239 214.9778945 471.677456 46.35958317 2010 1 100 19.75620711 90.91830698 32.17766066 22.65911124 8.800738338 983.8128202 572.1391186 228.4610316 36.0998782 2010 2 100 . . . . . . . . . 2010 3 100 40.23695125 160.1708763 56.84114851 43.95425939 15.97703292 844.9377311 165.3848988 395.9448701 70.71768058 2010 4 100 39.49541338 165.2380254 72.94705855 61.48610855 19.78580471 1694.923377 375.0076342 452.7027246 112.6320248 2010 1 150 29.17391059 146.0596519 41.35851502 27.39513568 8.585319357 1217.58392 356.4985655 215.2392336 52.84359265 2010 2 150 42.14781867 182.3086467 38.09205919 27.21455808 11.50227113 705.5620629 513.7144775 149.8433957 42.07550545 2010 3 150 21.61727306 100.8455303 23.58177918 17.68317749 5.770053086 1003.787448 108.0922011 181.4767418 32.98945888 2010 4 150 26.27365395 102.0839736 48.21905949 32.20168012 10.92664755 1549.968598 689.5147022 179.8790506 45.38471284 2010 1 150 90.12198767 335.6557951 61.93483366 45.13260277 26.58231555 1208.749914 557.3646811 559.544315 112.6826941 2010 2 150 40.63578486 199.6412647 55.45121722 42.56902633 17.8703193 1426.62465 625.8871843 345.8600943 93.60553302 2010 3 150 . . . . . . . . . 2010 4 150 13.81444854 76.18666617 53.30081006 32.99333425 11.50771322 1226.181339 356.1319753 227.1075861 64.67249475 2010 1 200 36.24187656 161.3639617 68.31395969 54.13519856 19.15386593 1287.219124 1089.357562 445.32061 126.4852115 2010 2 200 18.05426528 108.757744 30.18998264 25.53895939 9.528298046 759.3003967 428.8460008 330.3701127 55.08366035 2010 3 200 19.2011212 151.3570521 25.76220698 20.23923355 7.321530288 694.3277201 417.8765815 311.0709451 35.41433768 2010 4 200 22.37841439 76.89907042 28.57904018 23.09799402 7.450518114 704.5447576 513.0263221 193.8008006 31.14502682 2010 1 200 34.26068639 144.1316132 41.46088563 30.75559695 10.36991 1043.554005 322.9054144 312.2046033 68.34812871 2010 2 200 33.55711355 188.4639213 36.71040355 30.28894566 12.49590105 1366.219169 624.8784468 348.7630316 65.83708884 2010 3 200 21.51488004 150.5480152 33.46114888 30.24339775 11.79458403 994.2632311 272.8587974 303.3570693 56.29491959 2010 4 200 16.37368621 79.64312733 42.47335618 30.68214211 11.18654681 586.7087488 681.229829 179.77403 47.36361763 ; proc print; run;
Then here is my current log:
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; NOTE: ODS statements in the SAS Studio environment may disable some output features. 69 70 options ls=150 ps=80; 71 72 data SScont; 73 infile cards expandtabs; 74 input year rep nrate tp tk tca tmg ts tfe tmn tzn tcu; 75 200910......... ____ 180 ERROR 180-322: Statement is not valid or it is used out of proper order. 76 20092017.3184707470.26260978.4170483946.7344829693.700073168452.978787176.01810422148.486197119.71026264 77 20093010.9986456553.306765428.2106615345.7851808894.113729417135.212147677.21748144126.572425913.88752562 78 20094015.60271095100.089627616.1959956315.378794397.282917703505.5302851261.2628173191.734699343.53840606 79 20091016.6528897597.2957690411.0878903910.681536776.923796632304.1101348457.2981062276.595189627.79592896 80 20092012.1422346846.341013075.4053331445.133468563.487627818169.74360174.82774341103.378021919.07940953 81 20093015.8291388183.1115481710.631410328.8479570513.767754241437.455089356.03477618220.347893724.34993967 82 2009408.90047993468.0479110611.9983109611.48407333.640000096339.9594832175.1659218128.766809839.07438612 83 200915015.0669032664.371865447.0206545697.383830793.403774393684.9998263138.611227185.613073322.84513706 84 200925016.2223943276.601835039.0116983648.0258585154.298272606383.9924324116.8829353158.719335432.44234549 85 2009350......... 86 200945011.6609866584.4837165614.378222814.093932057.122866668267.2143139400.1753818142.703068427.71415246 87 200915015.2384202881.592320159.4227676558.5544611786.525354361297.1875195291.183362181.507805425.29085093 88 200925016.9004964573.383277811.5394380910.77651266.122028852198.2920021234.8992982148.560407124.00987855 89 200935017.3049937975.330144998.7591963988.1827335214.163198184331.387636267.89253989284.238424530.23699468 90 2009450......... 91 2009110010.6572280458.7776494610.4239049810.888171224.073565268487.2298963167.9104985135.900277625.67570655 92 2009210012.4112184560.628506256.0733334255.4526867192.61996532346.049419952.22044458132.625303922.22142899 93 2009310010.8188999563.4301464511.5108733411.007633784.722297256402.163266525.65806712157.310497623.14301135 94 2009410015.95382867116.774219421.8220487221.083478258.6273669311182.62809580.07876395254.18340.96185378 95 2009110011.1670695767.4845100314.2417080314.625815577.357059844336.5285587374.3575559178.782825728.26802855 96 2009210015.1787383753.952007768.9209493287.5034327823.665155119266.559327793.51316308173.600984119.24046567 97 2009310016.07913684103.992112518.8605594419.937270895.920947487737.9688187264.9280403228.618380454.77679023 98 2009410018.21484258145.204227715.9330033215.633236376.295949515844.2610016200.1829065319.812194833.15170536 99 2009115012.9425800960.815331329.2783744018.7465656552.697618558400.160843577.18041197158.562879722.27840507 100 2009215013.9029107372.698178979.2157614428.5453353373.358327771366.0288997136.1867274106.218007125.21317725 101 2009315011.1466512981.8015806913.3994739714.98449055.373056828387.6889368287.301147186.821351245.94006072 102 2009415010.7639663195.263250436.4593967231.588524258.715424616801.2853693386.1106965284.846957481.19771716 103 2009115015.6598113978.8221751712.6716345112.133099096.585733864249.8565339213.8531791196.477483426.515004 104 2009215016.4097428699.6817428821.6014804619.02649168.48183946334.805911316.9710717119.708870941.09379991 105 200931509.641901245110.593319215.5701941218.487996124.547168951979.884066986.52092865256.695796952.86711034 106 2009415023.55546016136.239727225.2352913922.03669556.6301616241146.247654164.934071415.164173547.47602146 107 2009120012.7804165953.7277234311.3437901610.968459612.677565897459.555737592.70399721193.493435234.13704327 108 200922009.490275333102.20587311.7446345115.108704443.937438513529.223458888.38217614209.563470142.33683886 109 200932008.63606592885.8969361320.035870921.822024097.38017573433.6890867116.4399435269.753219366.70735152 110 2009420013.09315412103.215660728.6576341826.707171569.913034311434.6859166497.0688963221.809647375.68512917 111 2009120021.25238117119.845529820.7013441422.2668013111.34585488529.13832448.0416877350.435656474.91156923 112 2009220021.05554286133.87739122.8196290122.4879084110.49346363884.6127618320.5323254243.966123353.36306195 113 2009320013.3182188283.3391761920.1313733621.569238065.511534948764.1437813266.3053845179.088666452.52822117 114 2009420015.92788435108.18726114.5301298316.032267276.288120557417.4854977242.6216791185.287085739.38171664 115 20101027.97652334123.610787815.7818284613.828999357.447690678771.2563015308.156919275.609082727.92759468 116 201020......... 117 20103028.75588845127.086690620.792220213.322510316.700895875694.4815235141.1975872293.244825818.75642257 118 20104024.35093517124.100661719.8605302113.410007127.063051843607.4967834193.6587115212.30656622.62350939 119 20101018.18097766110.635774815.886481611.09421197.842969683322.6278325570.0637507209.042129818.24601774 120 20102050.57393337260.604246333.14210222.2461096814.64993011599.6456501402.6635394368.062461134.93510173 121 20103043.63298344256.623263539.233658223.3618378511.96854061642.3575202287.8941402421.979068933.90687608 122 20104025.14145166135.725956630.195905418.382020719.828554086449.4676623261.8462061230.828964327.97526266 123 201015036.81203289125.939428.2445342123.127319749.562274211539.1926842486.1233039344.684735534.83284132 124 2010250......... 125 201035027.83875346101.83002930.7101720921.203770987.500850423877.6069458423.7781966177.692618445.22102762 126 201045023.10412042112.71219220.6812543316.985030926.568176793655.2341962318.2147612209.483834918.18620473 127 201015038.86314555158.244875635.4493769826.1152842513.86798281465.2011687615.862353328.40968734.55425234 128 201025042.579125167.099138240.3106105327.5649894713.11406257337.7963487482.719875350.167881635.31890592 129 201035049.32475455217.584679438.8656028728.9431902414.82419373677.9356383393.4476656324.371087535.47621869 130 201045024.83776843131.914780632.4102507726.9355477510.77355455681.5653405452.9142137229.594281627.89298581 131 201011007.60048116344.0333983432.045920522.118764829.016353934418.8459801524.9182803120.923743842.36574172 132 2010210029.41985418166.510716536.4447572429.999173419.3852550691189.278919323.9652499279.437626250.05776028 133 2010310025.99876449134.423058245.7906168432.9590927810.754794131202.208824497.6942571232.036895262.81824075 134 2010410045.01233924193.413464844.0090387424.9822209611.284492881286.912239214.9778945471.67745646.35958317 135 2010110019.7562071190.9183069832.1776606622.659111248.800738338983.8128202572.1391186228.461031636.0998782 136 20102100......... 137 2010310040.23695125160.170876356.8411485143.9542593915.97703292844.9377311165.3848988395.944870170.71768058 138 2010410039.49541338165.238025472.9470585561.4861085519.785804711694.923377375.0076342452.7027246112.6320248 139 2010115029.17391059146.059651941.3585150227.395135688.5853193571217.58392356.4985655215.239233652.84359265 140 2010215042.14781867182.308646738.0920591927.2145580811.50227113705.5620629513.7144775149.843395742.07550545 141 2010315021.61727306100.845530323.5817791817.683177495.7700530861003.787448108.0922011181.476741832.98945888 142 2010415026.27365395102.083973648.2190594932.2016801210.926647551549.968598689.5147022179.879050645.38471284 143 2010115090.12198767335.655795161.9348336645.1326027726.582315551208.749914557.3646811559.544315112.6826941 144 2010215040.63578486199.641264755.4512172242.5690263317.87031931426.62465625.8871843345.860094393.60553302 145 20103150......... 146 2010415013.8144485476.1866661753.3008100632.9933342511.507713221226.181339356.1319753227.107586164.67249475 147 2010120036.24187656161.363961768.3139596954.1351985619.153865931287.2191241089.357562445.32061126.4852115 148 2010220018.05426528108.75774430.1899826425.538959399.528298046759.3003967428.8460008330.370112755.08366035 149 2010320019.2011212151.357052125.7622069820.239233557.321530288694.3277201417.8765815311.070945135.41433768 150 2010420022.3784143976.8990704228.5790401823.097994027.450518114704.5447576513.0263221193.800800631.14502682 151 2010120034.26068639144.131613241.4608856330.7555969510.369911043.554005322.9054144312.204603368.34812871 152 2010220033.55711355188.463921336.7104035530.2889456612.495901051366.219169624.8784468348.763031665.83708884 153 2010320021.51488004150.548015233.4611488830.2433977511.79458403994.2632311272.8587974303.357069356.29491959 154 2010420016.3736862179.6431273342.4733561830.6821421111.18654681586.7087488681.229829179.7740347.36361763 155 ; ERROR: No DATALINES or INFILE statement. NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.SSCONT may be incomplete. When this step was stopped there were 0 observations and 12 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 682.59k OS Memory 25252.00k Timestamp 08/31/2021 04:11:30 PM Step Count 131 Switch Count 2 Page Faults 0 Page Reclaims 131 Page Swaps 0 Voluntary Context Switches 11 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 288 156 proc print; 157 run; NOTE: No observations in data set WORK.SSCONT. NOTE: PROCEDURE PRINT used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 648.12k OS Memory 25252.00k Timestamp 08/31/2021 04:11:30 PM Step Count 132 Switch Count 0 Page Faults 0 Page Reclaims 56 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 0
So, it is getting closer! At least it is reading the values with spaces now I think. But we still have an error.
Thoughts?
You removed the CARDS statement. (In spite of all talking about artificial intelligence, the SAS DATA step is not intelligent enough to insert it automatically when you say "infile cards ...".)
@FreelanceReinh Hahaha! Thank you!
It did finally run!! Thank you!
But, there is a mistake in the printed data if you look at my code containing my data in my previous post and then look at the SAS output:
2009 | 1 | 0 | . | . | . | . | . | . | . | 2009.00 | 2.000 |
2009 | 3 | 0 | 10.9986 | 53.307 | 8.2107 | 5.7852 | 4.1137 | 135.21 | 77.22 | 126.57 | 13.888 |
2009 | 4 | 0 | 15.6027 | 100.090 | 16.1960 | 15.3788 | 7.2829 | 505.53 | 261.26 | 191.73 | 43.538 |
You can see that it grabbed the next data line for variable tzn and tcu in Observation 1, which made the second line of observations incorrect by essentially omitting most of the data points for the second line of data in my code. Thoughts?
Thank you for helping me proofread my code!
@mmaw wrote:
But, there is a mistake in the printed data if you look at my code containing my data in my previous post and then look at the SAS output:
2009 1 0 . . . . . . . 2009.00 2.000 2009 3 0 10.9986 53.307 8.2107 5.7852 4.1137 135.21 77.22 126.57 13.888 2009 4 0 15.6027 100.090 16.1960 15.3788 7.2829 505.53 261.26 191.73 43.538 You can see that it grabbed the next data line for variable tzn and tcu in Observation 1, which made the second line of observations incorrect by essentially omitting most of the data points for the second line of data in my code.
Sorry for the delay (I was out of the office). This output would occur if only seven missing values (represented by periods) were contained in the first data line. But there are nine, one for each of the variables tp, tk, ..., tcu, and the data are read correctly in my desktop SAS session. To avoid the problem even if one or more missing values (periods) at the end of a data line were omitted, you can add the MISSOVER or TRUNCOVER option to the INFILE statement, e.g.
infile cards expandtabs truncover;
I will be back tomorrow (CEST time zone).
@FreelanceReinh Thank you so much! Your edits to my code did the trick! It worked beautifully last night, so I was able to run some results.
Thanks for your patience and taking time to explain thi!
I can't imagine how the SAS data step compiler could be more helpful than with this message:
ERROR: No DATALINES or INFILE statement.
😉
When dealing with data that may contain missing values, always use the DSD and TRUNCOVER options in the INFILE statement, along with the correct delimiter. If you have tabs as delimiter, use
infile datalines dlm='09'x dsd truncover;
@Kurt_Bremser Thank you for giving me a simple, practical solution to this issue. Right! It is pretty clear, you just have to know what to do with it....hahahaha
Again, thank you for giving me a practical fix!
Please post such logs into a text box opened on the forum using the </> icon that appears above the message window.
The main message windows reformat text and what we see may not be what you actually paste.
I copied your data step into my SAS editor and ran the code without any errors.
It may be that there are characters in your data lines that are getting remapped by the forum that were considered invalid when you run the code.
This bit
86 CHAR 2009.1.50.15.23842028.81.59232015.9.422767655.8.554461178.6.525354361.297.1875195.291.183362.181.507 ZONE 3333030330332333333330332333333330323333333330323333333330323333333330333233333330333233333303332333 NUMR 200991950915E23842028981E5923201599E42276765598E55446117896E5253543619297E18751959291E1833629181E507
^ ^ ^
Where the columns above my ^ that show 09 (0 from the Zone row, 9 from Numr row) indicate that you have a tab character, '09'x , not a space which would be '20'x or appear in column as 20.
@ballardw Thank you for this! Yes, that is one of my issues! I have usually pasted my data into SAS so it makes it challenging for me learning the additional coding bits to make it work smoothly. I have another error message appearing now, as given in my reply to @FreelanceReinh .
Thank you so much for your time and expertise!
@mmaw wrote:
@ballardw Thank you for this! Yes, that is one of my issues! I have usually pasted my data into SAS so it makes it challenging for me learning the additional coding bits to make it work smoothly. I have another error message appearing now, as given in my reply to @FreelanceReinh .
Thank you so much for your time and expertise!
Depending on which version of the SAS editor you are using you may look for a "replace tabs with spaces" option. That may help with inline data. When you save the program the editor would change tabs to spaces. Then the program may run.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.