Run the code.
Read the log.
IF the code you have pasted is what you actually run you should have errors like this:
162 infile `employee';. - --- 22 23 200 ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string.
Note that the _ is under a character that looks like this: `
If you enter code into the editor and use the key to the right of the one with : you will get ' if you use the one in the upper left of the keyboard you get ` They are not the same character. SAS expects ' or " to surround character values.
the same thing happens with `Ruth' you can see that the mark before the R is not the same as the one at the end.
Notice the code box with the log result. If I paste the same thing into the main body:
162 infile `employee';.
- ---
22 23
200
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string.
and we cannot see where the _ is indicating the error because the message board reformatted the text from the log.
There is another possible issue with the INFILE statement. If you use: Infile 'employee'; SAS will look for the file from the location that SAS is currently running which is very likely not to be where the file is located. You should specify a fully qualified path, which is operating system dependent, to the file. That different operating systems use different path structures is likely ignored for this test problem to make the question non-operating system dependent.
Run the code.
Read the log.
IF the code you have pasted is what you actually run you should have errors like this:
162 infile `employee';. - --- 22 23 200 ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string.
Note that the _ is under a character that looks like this: `
If you enter code into the editor and use the key to the right of the one with : you will get ' if you use the one in the upper left of the keyboard you get ` They are not the same character. SAS expects ' or " to surround character values.
the same thing happens with `Ruth' you can see that the mark before the R is not the same as the one at the end.
Notice the code box with the log result. If I paste the same thing into the main body:
162 infile `employee';.
- ---
22 23
200
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string.
and we cannot see where the _ is indicating the error because the message board reformatted the text from the log.
There is another possible issue with the INFILE statement. If you use: Infile 'employee'; SAS will look for the file from the location that SAS is currently running which is very likely not to be where the file is located. You should specify a fully qualified path, which is operating system dependent, to the file. That different operating systems use different path structures is likely ignored for this test problem to make the question non-operating system dependent.
input employee_name $ 1-4; there is not @ at the end of it. So the point will go to the next line , therefore you will get 22.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.