Multiple Programming Languages Quiz
Test your knowledge across multiple programming languages including PowerBuilder, SAS, C/C++, and PL/SQL
Questions
What statements must be used in order to raise a user-defined exception in PL/SQL?
- RAISE
- PRAGMA EXCEPTION_INIT
- OTHERS
- EXCEPTION
What will be the output of the following: void main() { int i; for(i=1;i<=4;i++) { printf("%d",i); continue; } }
- 1
- 1234
- 123
- 234
What will be the output of the following: void main() { float a=0.7; if(a<0.7) printf("c++"); else printf("c"); }
- c++
- c
- Compile time error
- None of these
What will be the output of the following: void main() { char * const ptr="abc"; ptr="xyz"; printf("%s",ptr); }
- abc
- xyz
- Compile time error
- None of these
What will be the output of the following: void main() { char const *ptr="abc"; ptr="xyz"; printf("%s",ptr); }
- None of these
- Compile time error
- abc
- xyz
What will be the output of the following: void main() { register int a; printf("%d",a); }
- 0
- Garbage value
- Compile time error
- 1
What is the use of the double trailing "@@" in an input statement?
- loads a new record into the input buffer if an end-of-record is found in the current record
- holds the current data line in the buffer for another input statement to process
- can be used to read multiple observations from a single data line
- is a syntax error
The following SAS program is submitted: data work.month; date = put('13mar2000'd,ddmmyy10.); run; Which one of the following represents the type and length of the variable DATE in the output data set?
- numeric, 8 bytes
- numeric, 10 bytes
- character, 8 bytes
- character, 10 bytes
A raw data file is listed below: --------10-------20-------30 1901 2 1905 1 1910 6 1925 . 1941 1 The following SAS program is submitted and references the raw data file above: data coins; infile 'file-specification'; input year quantity; run; Which one of the following completes the program and produces a non-missing value for the variable TOTQUANTITY in the last observation of the output data set?
- totquantity = sum(totquantity + quantity);
- totquantity + quantity;
- totquantity 0; sum totquantity;
- retain totquantity 0; totquantity = totquantity + quantity;
In the following SAS program, the input data files are sorted by the NAMES variable: libname temp 'SAS-data-library'; data temp.sales; merge temp.sales work.receipt; by names; run; Which one of the following results occurs when this program is submitted?
- The program executes successfully and a temporary SAS data set is created
- The program executes successfully and a permanent SAS data set is created
- The program fails execution because the same SAS data set is referenced for both read and write operations
- The program fails execution because the SAS data sets on the MERGE statement are in two different libraries
The following SAS program is submitted: data work.new; length word $7; amount = 7; if amount = 5 then word = 'CAT'; else if amount = 7 then word = 'DOG'; else word = 'NONE!!!'; amount = 5; run; Which one of the following represents the values of the AMOUNT and WORD variables?
- amount word ------ 5 DOG
- amount word ------ 5 CAT
- amount word ------ 7 DOG
- amount word ------ 7 ' ' (missing character value)
Which one of the following statements is true regarding the name of a SAS array?
- It exists only for the duration of the DATA step.
- It is saved with the data set.
- It can be used in procedures.
- It can be the same as the name of a variable in the data set.
The following SAS program is submitted: data work.test; array agent{4} $ 12 sales1 – sales4; run; Which one of the following represents the variables that are contained in the output data set?
- SALES1, SALES2, SALES3, SALES4
- AGENTS1, AGENTS2, AGENTS3, AGENTS4
- None, the DATA step fails because the ARRAY statement can reference only numeric data
- None
On which portion(s) of a SAS data set does the PRINT procedure report?
- the data portion only
- the descriptor portion only
- the descriptor portion and the data portion
- neither the data portion nor the descriptor portion
The following SAS program is submitted using the raw data file as input: data work.homework; input name $ age height; if age LE 10; cards; John McCloskey 35 71 June Rosesette 10 43 TinekeJones 9 37 ; run; How many observations will the WORK.HOMEWORK data set contain?
- No data set is created as the program fails to execute due to errors
- 0
- 2
- 3
The following SAS program is submitted: data allobs; set sasdata.origin (firstobs = 75 obs = 499); run; The SAS data set SASDATA.ORIGIN contains 1000 observations. How many observations does the ALLOBS data set contain?
- 425
- 424
- 499
- 1000
A raw data record is shown below: 07Jan2002 Which one of the following informats would read this value and store it as a SAS date value?
- date9.
- ddmonyy9.
- ddMMMyy9.
- ddmmmyyyy9.
Which method will be used to change the datawindow query at runtime?
- ModifyQuery()
- Modify()
- Change()
- ChangeQuery()
Which is not a Datawindow Buffer?
- Primary!
- Delete!
- Original!
- Sort!
Which will be the best method to handle DB transactions if number of connections are limited?
- SetTransObject()
- SetTrans()
- SetDBTrans()
- SetLimitTrans()