Question : Select the correct statement which is not an advantage of column input, while Reading Raw Data with the INPUT Statement?
1. It can be used to read character variables that contain embedded blanks 2. No placeholder is required for missing data. 3. Access Mostly Uused Products by 50000+ Subscribers 4. Fields do not have to be separated by blanks or other delimiters
Explanation: Column input is useful for reading standard values only.
Column input enables you to read standard data values that are aligned in columns in the data records. Specify the variable name, followed by a dollar sign ($) if it is a character variable, and specify the columns in which the data values are located in each record: data scores; infile datalines truncover; input name $ 1-12 score2 17-20 score1 27-30; datalines; Riley 1132 987 Henderson 1015 1102 ; Note: Use the TRUNCOVER option in the INFILE statement to ensure that SAS handles data values of varying lengths appropriately. [cautionend] To use column input, data values must be: in the same field on all the input lines in standard numeric or character form. Note: You cannot use an informat with column input. [cautionend] Features of column input include the following: Character values can contain embedded blanks. Character values can be from 1 to 32,767 characters long. Placeholders, such as a single period (.), are not required for missing data. Input values can be read in any order, regardless of their position in the record. Values or parts of values can be reread. Both leading and trailing blanks within the field are ignored. Values do not need to be separated by blanks or other delimiters.
Question : Which of the following program correctly reads the instream data
Correct Answer : Get Lastest Questions and Answer : Explanation: Because, it is fixed width data. Hence, column positions are required. And at the same time you have to provide datalines; or cards; statement to read inline data. If condition is required only for filtering out the data. Based on this option B is correct.
Question : You have been given below dataset
You need to process the dataset which has either MUMBAI or AHMEDABAD as a location and fee is higher than 500, which of the following statement is correct for this?
1. if fee=5000 and location NOT in ('MUMBAI' ,'AHMEDABAD');
2. if fee>=5000 and location AND ('MUMBAI' ,'AHMEDABAD');
4. if fee>5000 OR location OR ('MUMBAI' ,'AHMEDABAD');
Correct Answer : Get Lastest Questions and Answer : Explanation: To filter the data you can use if statement. However, you should be aware how the operators can be used. In this case IN clause will help you to filter the records which only satisfy the one of the condition in parenthesis. As well as greater than symbol will be used to satisfy fee condition. To satisfy all the conditions together you can use and operator for that.