COBOL and SAS Programming Basics
Quiz covering fundamental concepts and syntax in COBOL and SAS programming languages
Questions
y=intnx('year','21oct2009'd,3,'mid')What is the value of y?
- 01jun2012
- 21jul2012
- 19175 - Numeric equivalent of the date 01jul2012
- 21oct2012
The option that has to be used in order to debug a sas program is
- option debug=yes;
- data x/DEBUGGER;
- data x /DEBUG;
- option debug;
first = 'London,england'; city=substr(first,1,6); new_city=city||","||'England'; What is the value of new_city?
- Syntax Error
- london ,England
- london,england
- london, England
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?
- No observations
- sno amt { 30 300}
- sno amt { 10 100} {15 200}
- sno amt { 10 100} {15 200} {30 300}
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
- Babu arun
- Syntax Error
- arun Babu
- No observations
data new;input x $ @;if X='A' theninput y;datalines;A 1A 2B 3;run;What is the output?
- No observations
- x y {A 1} {A 2} {B 2}
- x y {A 1} {A 2}
- x y {A 1} {A 2} {B .}
proc sort data=new dupout=newdup;by x;run;What is the result of the above proc execution?
- Warning is displayed : NODUPKEY or NODUPREC not specified
- The duplicates are written into the dataset newdup
- syntax Error
- The unique records are written into the dataset newdup
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
- input @ 1 'IP:' address $;
- input @ 'IP:' address :$16. ;
- input @ 'IP:' address $16 ;
- input @ 'IP:' address $;
In the ENVIRONMENT DIVISION which paragrahs should a program (not a subroutine) have?
- ERROR RECOVERY
- ROLLBACK
- Any one of the above
- Both of the above
In the ENVIRONMENT DIVISION which of the following paragrahs should a subroutine have (using same schema)?
- ERROR RECOVERY
- ROLLBACK
- None of the above
- Both of the above
Levels are indented by multiples of ___ columns?
- 2
- 4
- 1
- No Compulsion
What is the format of date in the REMARKS ______?
- DD-MMM-YY
- DD-MMM-YYYY
- MMM-DD-YY
- MMM-DD-YYYY
R$Core should not be used for ------ SORT?
- EXTERNAL
- INTERNAL
- BOTH
- NONE OF THESE
--------- should be used as default qualifier and account-id in @run statement.
- PRODUCTION
- CCL
- YYY
- ANY OF THESE
INITIALIZE can be used for large Group varibales?
- True
- False
INITIALIZE can be used for small Group varibales?
- True
- False
What all needs to be registered while working on a new program/ecl
- ECL + Program + Input files
- Program+input file
- ECL + Program
- Program only
we should avoid VALUE clause in programs for dynamic variables?
- True
- False