0
Alien head

programming languages Online Quiz - 257

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

Find out the error in the following code? Libname output_dir “c:\mydocuments\output”; Data output_dir.test; Infile datalines dlm=’,’; Input name $ total; If total > 50; Datalines; Sharma,50 Thiyaga,90 Ashok,60 Run;

  1. No Errors

  2. Error in the LIBNAME Statement

  3. Error in the Datalines statement

  4. Error in the infile statement


Correct Option: B

What is the length of variable a ? data temp; a=substr('joshi anand',1,3); run;

  1. 3

  2. 11

  3. 8

  4. 200


Correct Option: B

Which procedure can be used to see the descriptor portion of a dataset?

  1. Proc freq

  2. Proc print

  3. Proc datasets

  4. Proc contents


Correct Option: D

A SAS code has been executed and it has an error on the 10th line of the code. What will be the value of the automatic variable ERROR?

  1. 0

  2. 10

  3. 1

  4. 11


Correct Option: C

I want to create a 2 way cross tabulation frequency based on Country and Sales using FREQ procedure. From the given options pick the correct code?

  1. Proc freq; Tables country sales; Run;

  2. Proc freq; Table country sales; Run;

  3. Proc freq; Tables country * sales; Run;

  4. Proc freq; Table country * sales; Run;


Correct Option: C

Dataset Temp contains 1 observation and 30 variables. Which procedure can be used to convert it into 30 observations with 1 variable in an efficient manner?

  1. Proc tabulate

  2. Proc report

  3. Proc transpose

  4. Proc Invert


Correct Option: C

What is the use of PUT function in a DATA step?

  1. converts character to numeric

  2. onverts numeric to character

  3. writes the values to the output file

  4. None of the above


Correct Option: B

What is the output of the following sum statement? X1=9, X2=4, X3=1 Z=sum(of X1-X3);

  1. 8

  2. 10

  3. 14

  4. 12


Correct Option: C

What does the line hold specifier single trailing(@) do when used in an input statement?

  1. holds the input record for the next INPUT statement to read in the same iteration of the DATA step

  2. holds the input record for the next INPUT statement to read across further iterations of the DATA step

  3. holds the input record for the current input statement to read across further iterations of the DATA step

  4. All of the above


Correct Option: A

At compile time when an external file is read, what items are created?

  1. Program data vector (PDV) and Descriptor portion

  2. Input buffer, Program data vector (PDV) and Descriptor portion

  3. Input buffer and Descriptor portion

  4. None of the above


Correct Option: B

How many observations will be there in the output dataset person? Data person; infile datalines; input name $ dept $ age; if age le 30; datalines; John Sales 38 Mary Brown Acctng 32 Spielberg Manager 28 ;

  1. 2

  2. 3

  3. 1

  4. 0


Correct Option: A

Which of the following can be used to read numeric values that contain numeric values and commas into a SAS dataset?

  1. comma. informat

  2. dollar. format

  3. comma. format

  4. w.d informat


Correct Option: A

How many observations will be there in the output dataset TEMP? Data temp; Set test (firstobs=50 obs=450); Run;

  1. 450

  2. 401

  3. 400

  4. 500


Correct Option: B

Which date function advances a date, time or date/time value by a given interval?

  1. INTCK

  2. INTNX

  3. INTCX

  4. INTNK


Correct Option: B

How does the following macros will resolve? What will be the output in log file? %let one=two; %let two=three; %let three=one; %put &one; %put &&one; %put &&&one;

  1. two, two, one

  2. two, three, one

  3. two, two, three

  4. two, two, two


Correct Option: C

How are numeric and character missing values represented internally in SAS?

  1. numeric will be represented by blank and character will be represented by .

  2. both character and numeric will be represented as blanks

  3. numeric will be represented by . and character will be represented by blank

  4. numeric will be represented by . and character will be represented by NULL values


Correct Option: C

How many variables will be there in the output dataset totmark? Data totmark; Set scores (keep=name mark1 mark2 ); Total = mark1 + mark2; Drop mark1 mark2; Run;

  1. 2

  2. 4

  3. 5

  4. 1


Correct Option: A

What is the SAS data value of 01-Jan-1960?

  1. 21916

  2. 1

  3. 0

  4. None of the above


Correct Option: C

What is the use of %INCLUDE statement in a program?

  1. Includes external files

  2. Includes SAS datasets

  3. Includes variables from other datasets

  4. All of the above


Correct Option: A

What is the value stored in the variable x? Data test; name = ’TATA CONSULTANCY SERVICES’; b = ’C’; x = INDEX (name, b); Run;

  1. 2

  2. 23

  3. 6

  4. 5


Correct Option: C
+ View questions