programming languages Online Quiz - 120
|Description: programming languages Online Quiz - 120|
|Number of Questions: 20|
|Created by: Aliensbrain Bot|
|Tags: programming languages|
Flat file structure is as below 1----5----10 dan 23 45 bob 44 50 sue 30 80 mam 40 50 The following code is submitted. data temp; infile ‘file specification’; input x $ 1-3; if x='sue' then input age 5-6; else input height 8-9; run; what would be the value of variable AGE in the dataset TEMP when variable X has the value ‘Sue’?
Flat file structure is as below (Very good question) 1----5----10 vital reddy 45 vijay 30 sarma 40 The following code is submitted. data temp; infile ‘file specification’; input x $ age; if age<=40; run; How many observations will be there in the TEMP dataset?
To answer this question, let's go through the given code step by step:
The code reads data from a file using the INFILE statement and stores it in the TEMP dataset.
The INPUT statement is used to specify the variables to be read from the file. In this case, it reads the variable 'x' as a character variable and 'age' as a numeric variable.
The IF statement is used to filter the observations based on the condition 'age<=40'. It only keeps the observations where the age is less than or equal to 40.
Given the flat file structure, the observations with the following ages meet the condition:
- vital reddy (age 45) does not meet the condition
- vijay (age 30) meets the condition
- sarma (age 40) meets the condition
Therefore, there will be a total of 2 observations in the TEMP dataset that meet the condition.
So, the correct answer is B) 2 observations.
The following code is submitted. data temp; salary='20000'; bonus=0.1*salary; run; What would be the value of BONUS variable in the dataset TEMP?
We can write the program without main() in C language
data temp; salary=.; if salary=. then salary=100; bonus=10; salary=.; total=sum(salary,bonus); run; What would be the value of TOTAL variable in the dataset TEMP?
Following code is submitted. data temp: do i=1 to 3; do j=1 to 4; salary=salary+300; end; end; run; how many observations will present in the dataset TEMP?
The variable JOBCODE has length $5 in the dataset TEMP. The same variable present in the dataset TEMP1 and has length $7. data temp2; set temp temp1; run; what would be the length of the variable JOBCODE in the dataset TEMP2?
What is the maximum combined length of command line arguments including the space between adjacent arguments?
Which one is equivalent to multiplying by 2?
Which is the correct syntax for the function gcvt() in C?
To which numbering system can the binary number 1101100100111100 be easily converted to?
son,Travis, The following output is desired relation firstname son Travis Which one of the following statements will work correctly as exepcted ?
data sasdata.atlanta sasdata.boston work.portland work.phoenix; set company.prdsales; if region='NE' then output boston; if region='SE' then output atlanta; if region='SW' then output phoenix; if region='NW' then output portland; Which one of the following is true regarding the output datasets
----|----10----|----20----|----30 john McCloskey 35 71 June Rosesette 10 43 Tineke Jones 9 37 The following SAS program is submitted using the raw data file as input: data work.homework; infile 'file-specification'; input name $ age height; if age LE 10; run; How many observations will the WORK.HOMEWORK dataset contain?
The attribute information includes the variable’s name, type, ......
The general form of SUM statement is
The sum statement is equivalent to using the SUM function and the RETAIN statement, as shown here: retain variable 0; variable=sum(variable,expression);
The following SAS program is submitted: data work.flights; destination='CPH'; select(destination); when('LPR') city = 'London'; when('CPH') city='Copenhagen'; otherwise; end;run; Which one of the following is the value of the CITY variable?