data Emp_Salary infile "C:\Users\Mac\Desktop\Emp_Sal.txt" dlm='09'x if _n_ 0) i+1 end run ĭata test2 set emp_salary i=0 do while (i>0) i+1 end run ĥ) What is the difference between infile and input statements in SAS Dataset?Īns: Infile statement helps to reads raw files those are placed in your Opertaing System, Server or from SAS Datalines and load them into SAS environment for processing purpose. Here you have to use the If statement as the records are going to be read from raw file.
#Base sas interview questions free#
Hence, you are free to assume any certain condition to show the interviewer all your skills.įor answer purpose I’m assuming that I’ve to filter first 5 records from the file that contains 500 records.
There is no clarity in question that what should be the condition to filer record, as its an interview question. So, overall focus here is to which conditional statement is better to read the records from raw data file and also apply filter. Also, we only need to pull 5 records only based upon a certain condition out of 500 records. As mentioned in the question itself that we are reading from a text file. Also, suggest which conditional statement would work better here, Where or If, to filter the records?Īns: It needs to be understand here the what is the source of the data.