Question : As you know, SAS Data step is executed in two phase compilation and execution phase. During each phase some variables values are assigned or created. Which of the following will not be created in compilation phase?
1. Descriptor of the dataset
2. First observation will be created in compilation phase
Correct Answer : Get Lastest Questions and Answer : Explanation: All the variables are created during the compilation phase and will not be assigned values until the execution phase. Input Buffer: It is created only when data read from a RAW file, if data read from SAS dataset then it will be read into PDV directly. Program Data Vector: Once input buffer is created, now PDV will be created. PDV is again logical area in the Memory and SAS build it data sets in it observation by observation. There are automatic variables are also created in this phase. - _N_ : Counts the number of times data steps is being iterated. - _ERROR_ : If any error occurs during the data read, 1 will be set else remain 0. Descriptor Portion: It is a description of the data, which can have below information. - Name of the data set and its member type. - Date and time when the data set was created. - Name, Data types(Numeric or character) and length of the variable. Extended Attribute: This is also the part of descriptor portion and its key, values. When you use CONTENTS PROC, you can see the descriptor portion of the data. During the compilation phase, no data will be created in SAS data set. First Observation: This will be created during the execution phase only, when raw file will be read.
Question : You have written a SAS program, one of your colleague told you that this program will not be compiled successfully, it has compilation error, and what does he mean? A. Values provided in if condition are wrong. B. Values provided in where clause are wrong. C. You have used one of the options in the DATA step, which is not valid D. You have missed the semicolon at the end of statement E. You have used the SAS keywords which are misspelled
Correct Answer : Get Lastest Questions and Answer : Explanation: When SAS compile the data steps, it does not look into the value part of any statement, it only look for syntax error. Which can be you have wrongly used the option in SAS statement, or you misspelled the SAS keyword or forgot to put semicolon in the statement. Syntax Checking: During the compilation each SAS statement from DATA step will be checked for syntax error. - Missing or misspelled keywords - Invalid variable names - Missing or invalid punctuation - Invalid option
Question : You have been running a DATA step on a raw file which contain records in it, while execution phase how many time DATA step will be executed
1. Only once for entire file
2. It cannot be predicted, because it depend on the file size and what is the input buffer size is configured.
4. It can be 50 times , if buffer is configured with 1 MB
Correct Answer : Get Lastest Questions and Answer : Explanation: In the execution phase, DATA step will be executed 1 time for each observation in a raw file. - Execution phase: Data Portion will be created in this phase. It follows the following step will be followed. o _N_ variable: Each time DATA step is executed, _N_ variables will increment by 1. o PDV : Any newly created variable will be set to missing in Program DATA Vector(PDV) o Now it will read an observation in either input buffer or directly into PDV. o Now remaining statements from the SAS program will be executed and PDV will be updated accordingly. o At the last statement of DATA step, entire observation will be written to SAS Data set. Only variables which are in SET, MERGE, MODIFY, or UPDATE statement will not be reset as missing in PDV. o Similarly for another observation above steps will be followed, until all the observations are done. o As soon end of file found for the raw data, it will terminate SAS data steps.