0

programming languages Online Quiz - 121

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

PROC SORT data = temp out=new; BY JOBCODE Descending SALARY; RUN; Temp DATASET What will be the output??

  1. "temp" dataset sorted by jobcode in desending order and salary in ascending order

  2. "temp" dataset sorted by jobcode in ascending order and salary in descending order

  3. "new" dataset sorted by jobcode in ascending order and salary in descending order

  4. "new" dataset sorted by jobcode in descending order and salary in ascending order


Correct Option: C
  1. d.) Will have values “TRUE” or “FALSE”

  2. c.) Will have values “YES” or “NO”

  3. b.) This variable appears in output dataset

  4. a.) Can be used in assignments/calculation in datastep.


Correct Option: D
  1. 14682 (nmber of days from 1st jan 1960)

  2. 13MAR2000

  3. Monday, March 13, 2000

  4. Mon, March 13, 2000


Correct Option: C
  1. OPTIONS PAGENO = 1;

  2. OPTIONS RESET PAGENO = 1;

  3. OPTIONS RESET PAGENUMBER = 1;

  4. OPTIONS PAGENUMBER = 1;


Correct Option: A

DATA TEMP; Infile ‘filename’; Input ID $5 @; If ID = ‘RAMES’ then input Y $6 Z $10 @; else ID = ‘VIJAY’ then input R $2 @; Input age 5.; RUN; How many lines are read from input file during one execution of dataset?

  1. 2

  2. 1

  3. 3

  4. 4


Correct Option: B

AI Explanation

To determine the number of lines read from the input file during one execution of the dataset, we need to analyze the code.

The code snippet provided is using the SAS programming language. Let's break down the code step by step:

  1. DATA TEMP;: This line initializes a SAS dataset named "TEMP".

  2. Infile 'filename';: This line specifies the input file to be read. However, the file name is not provided in the code snippet.

  3. Input ID $5 @;: This line reads the first 5 characters from each line of the input file into the variable "ID".

  4. If ID = 'RAMES' then input Y $6 Z $10 @;: This line checks if the value of "ID" is equal to 'RAMES'. If it is, then it reads the next 6 characters into the variable "Y" and the following 10 characters into the variable "Z".

  5. else ID = 'VIJAY' then input R $2 @;: This line is not valid SAS syntax. It seems to be a mistake in the code.

  6. Input age 5.;: This line reads the next 5 characters from each line of the input file into the variable "age".

  7. RUN;: This line indicates the end of the data step.

Based on the code provided, we can see that only one "input" statement is valid, which is Input ID $5 @;. Therefore, only one line is read from the input file during one execution of the dataset.

So, the correct answer is:

B) 1

  1. a.) FILE ‘filename’ dsd = ‘,’;

  2. b.) FILE ‘filename’ dlm = ‘ ’ dsd = ‘,’;

  3. c.) FILE ‘filename’ dlm = ‘,’;

  4. d.) FILE ‘filename’ csv = ‘,’;


Correct Option: C
  1. In datastep input is read from temporary location and output is written to temporary location.

  2. .) In datastep input is read from permanent location and output is written to temporary location.

  3. In datastep input is read from temporary location and output is written to permanent location.

  4. In datastep input is read from permanent location and output is written to permanent location.


Correct Option: D
  1. 11/31/2000

  2. 31/11/2000

  3. 31NOV2000

  4. 01NOVEMBER2000


Correct Option: C

What informat should be used to read the date variable in the flat file having the values like 02NOV2003?

  1. DATE9.

  2. MMDDYY8.

  3. MMDDYY10.

  4. none


Correct Option: A
- Hide questions