0

programming languages Online Quiz - 122

Description: programming languages Online Quiz - 122
Number of Questions: 20
Created by:
Tags: programming languages
Attempted 0/20 Correct 0 Score 0

$input =”12345”; $value1 = chop($input); $value2=chomp($input”); print $value1, $value2;

  1. 1234 and 1

  2. 12345 and 0

  3. 1234 and 0

  4. 5 and 0

  5. 1 and 0


Correct Option: D

How many times does the following loop iterates? %list = ("first", "1", "second", "2", "third", "3"); foreach $word (keys(%list)) { last if ($word == "second"); }

  1. four

  2. three

  3. two

  4. one

  5. Unpredictable


Correct Option: E

By default all our code is placed in one package called main

  1. True

  2. False


Correct Option: B

Which of the following is not a legal scalar variable

  1. $Scalar

  2. $_Scalar

  3. $Scalar1

  4. $Sca_lar


Correct Option: B

print 12e-02;

  1. 0.12

  2. 12

  3. 120

  4. 0.012


Correct Option: A

SAS programs have basically 2 steps .They are

  1. Base SAS

  2. DATA

  3. Macro

  4. PROC


Correct Option: B,D

A SAS program may contain a DATA step embedded within a PROC STEP and viceversa

  1. True

  2. False


Correct Option: B

SAS Statements – Usually begins with a keyword, always ends with a colon and are free format

  1. True

  2. False


Correct Option: B

Each time a step is executed, SAS software generates a log of the processing activities and the results of the processing.Separate sets of messages for each step in the program are produced.

  1. True

  2. False


Correct Option: A

Each time a step is executed, SAS software generates a log of the processing activities and the results of the processing.Separate sets of messages for each step in the program are produced.

  1. True

  2. False


Correct Option: A

Data Example2; Set Example1; Run; Proc Print Data = Example2; run; Here Proc step is executed first as Proc step always takes precedence in SAS .

  1. True

  2. False


Correct Option: B

Data Example2; Set Example1; Run; Proc Print Data = Example2; run; Here Proc step is executed first as Proc step always takes precedence in SAS .

  1. True

  2. False


Correct Option: B

In SAS log there are lines displayed with NOTE: ERROR: and WARNING:

  1. True

  2. False


Correct Option: A

In SAS log lines displayed with NOTE: contains

  1. Error messages

  2. Number of observations

  3. Usage of CPU in seconds

  4. Number of variables


Correct Option: B,C,D

The output created by the DATA step are

  1. Means Reports

  2. SAS Datasets

  3. Frequency Reports

  4. SAS Files


Correct Option: B,D

Some of the PROCs present in SAS are

  1. SUM

  2. MEANS

  3. FREQ

  4. DATASET


Correct Option: B,C,D

In Java, all non-static methods are by default "virtual functions." Only methods marked with the keyword final are non-virtual.

  1. True

  2. False


Correct Option: A

Which is the correct statement: a.) ODS HTML FILE = ‘file’; b.) ODS FILE HTML = ‘file’ c.) ODS FILE = ‘file’ d.) ODS HTML = ‘file’

  1. c

  2. b

  3. a

  4. d


Correct Option: C

Which ODS command closes the HTML file

  1. ODS HTML; CLOSE;

  2. ODS HTML CLOSE;

  3. ODS; HTML CLOSE;

  4. ODS CLOSE HTML;


Correct Option: B

data temp; set lib1.x lib2.y; length jobcode $12.; run; What would be the length of Jobcode in temp?

  1. 5

  2. 12

  3. 8

  4. Syntax error


Correct Option: B
Explanation:

To solve this question, the user needs to know the basics of SAS programming and the SET statement.

The SET statement merges two or more SAS data sets into a single data set. The resulting data set inherits the attributes of the first data set in the SET statement. In this case, the first data set is lib1.x, which contains a variable called Jobcode with a length of 12. Therefore, the resulting data set temp will also have a variable called Jobcode with a length of 12.

Now, let's go through each option and explain why it is right or wrong:

A. 5: This option is incorrect. The length of Jobcode was defined as 12 in the first data set in the SET statement, so it will be 12 in the resulting data set regardless of the length of Jobcode in the second data set.

B. 12: This option is correct. The length of the Jobcode variable is defined as 12 in the first data set in the SET statement. Since the resulting data set inherits the attributes of the first data set, the length of Jobcode in temp will also be 12.

C. 8: This option is incorrect. The length of the variable Jobcode was defined as 12 in the first data set in the SET statement, so it will be 12 in the resulting data set regardless of the length of Jobcode in the second data set.

D. Syntax error: This option is incorrect. There is no syntax error in the given code.

Therefore, the correct answer is:

The Answer is: B. 12

- Hide questions