Thought I would share this little incredibly irritating tidbit;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
data one;
infile in1 delimiter=',' truncover dsd lrecl=13;
input visitnumber $ flights blocks ;
label flights = 'Flights per day';
blocks = 'Blocks per day';
run;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ok - When you are reading in comma delimited text of varying width AND you are being efficient and including a label statement to help your users, (This is the irritating part) and when you accidentaly use that extra ';' after the first label statement - SAS reads in the comma delimited file just fine, it then hits the 'flights' label and creates the label - SAS then begins feeding you "invalid numeric data" for your 'blocks' variable. A subsequent Proc Print will show the first two variables as having values and the third variable with no values.
Believe me when I say that you and your cooworkers can stare at the code for quite some time without realizing what that inapropriate ';' is doing to your data.
The correct code is obviously;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
data one;
infile in1 delimiter=',' truncover dsd lrecl=13;
input visitnumber $ flights blocks ;
label flights = 'Flights per day'
blocks = 'Blocks per day';
run;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Sans the first ';' and all is well, three variables with two labels all with values, rather then three variables with values and one with no data.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.