COBOL and SAS Programming Basics

Quiz covering fundamental concepts and syntax in COBOL and SAS programming languages

18 Questions Published

Questions

Question 1 Multiple Choice (Single Answer)

y=intnx('year','21oct2009'd,3,'mid')What is the value of y?

  1. 01jun2012
  2. 21jul2012
  3. 19175 - Numeric equivalent of the date 01jul2012
  4. 21oct2012
Question 2 Multiple Choice (Single Answer)

The option that has to be used in order to debug a sas program is

  1. option debug=yes;
  2. data x/DEBUGGER;
  3. data x /DEBUG;
  4. option debug;
Question 3 Multiple Choice (Single Answer)

first = 'London,england'; city=substr(first,1,6); new_city=city||","||'England'; What is the value of new_city?

  1. Syntax Error
  2. london ,England
  3. london,england
  4. london, England
Question 4 Multiple Choice (Single Answer)

dataset sales sno amt 10 100 15 200 30 300 proc print data = sales; where sno < 20; where sno = 30; run; what is the result?

  1. No observations
  2. sno amt { 30 300}
  3. sno amt { 10 100} {15 200}
  4. sno amt { 10 100} {15 200} {30 300}
Question 5 Multiple Choice (Single Answer)

The contents of Dataset Emp is as follows {Ename} {Babu} {arun} proc sort data = Emp; by ename; run; The output will be: NOTE: { } are added for readability

  1. Babu arun
  2. Syntax Error
  3. arun Babu
  4. No observations
Question 6 Multiple Choice (Single Answer)

data new;input x $ @;if X='A' theninput y;datalines;A 1A 2B 3;run;What is the output?

  1. No observations
  2. x y {A 1} {A 2} {B 2}
  3. x y {A 1} {A 2}
  4. x y {A 1} {A 2} {B .}
Question 7 Multiple Choice (Single Answer)

proc sort data=new dupout=newdup;by x;run;What is the result of the above proc execution?

  1. Warning is displayed : NODUPKEY or NODUPREC not specified
  2. The duplicates are written into the dataset newdup
  3. syntax Error
  4. The unique records are written into the dataset newdup
Question 8 Multiple Choice (Single Answer)

The input file is like below {IP:10.236.130.102} {IP:10.160.236.202} {IP:10.236.119.99} . Read the IP address and store the IP numbers alone without having the IP word in the dataset. Required output is: address {10.236.130.102} {10.160.236.202} {10.236.119.99} Choose the correct option NOTE: { } is added for readability

  1. input @ 1 'IP:' address $;
  2. input @ 'IP:' address :$16. ;
  3. input @ 'IP:' address $16 ;
  4. input @ 'IP:' address $;
Question 9 Multiple Choice (Multiple Answers)

In the ENVIRONMENT DIVISION which paragrahs should a program (not a subroutine) have?

  1. ERROR RECOVERY
  2. ROLLBACK
  3. Any one of the above
  4. Both of the above
Question 10 Multiple Choice (Multiple Answers)

In the ENVIRONMENT DIVISION which of the following paragrahs should a subroutine have (using same schema)?

  1. ERROR RECOVERY
  2. ROLLBACK
  3. None of the above
  4. Both of the above
Question 11 Multiple Choice (Single Answer)

Levels are indented by multiples of ___ columns?

  1. 2
  2. 4
  3. 1
  4. No Compulsion
Question 12 Multiple Choice (Single Answer)

What is the format of date in the REMARKS ______?

  1. DD-MMM-YY
  2. DD-MMM-YYYY
  3. MMM-DD-YY
  4. MMM-DD-YYYY
Question 13 Multiple Choice (Single Answer)

R$Core should not be used for ------ SORT?

  1. EXTERNAL
  2. INTERNAL
  3. BOTH
  4. NONE OF THESE
Question 14 Multiple Choice (Single Answer)

--------- should be used as default qualifier and account-id in @run statement.

  1. PRODUCTION
  2. CCL
  3. YYY
  4. ANY OF THESE
Question 15 True/False

INITIALIZE can be used for large Group varibales?

  1. True
  2. False
Question 16 True/False

INITIALIZE can be used for small Group varibales?

  1. True
  2. False
Question 17 Multiple Choice (Multiple Answers)

What all needs to be registered while working on a new program/ecl

  1. ECL + Program + Input files
  2. Program+input file
  3. ECL + Program
  4. Program only
Question 18 True/False

we should avoid VALUE clause in programs for dynamic variables?

  1. True
  2. False