SAS, Java, and Perl Programming Basics
Test your knowledge of basic concepts in SAS programming, including DATA steps, PROC procedures, and ODS commands, along with fundamental Java and Perl language features.
Questions
$input =”12345”; $value1 = chop($input); $value2=chomp($input”); print $value1, $value2;
- 1234 and 1
- 12345 and 0
- 1234 and 0
- 5 and 0
- 1 and 0
How many times does the following loop iterates? %list = ("first", "1", "second", "2", "third", "3"); foreach $word (keys(%list)) { last if ($word == "second"); }
- four
- three
- two
- one
- Unpredictable
By default all our code is placed in one package called main
- True
- False
Which of the following is not a legal scalar variable
- $Scalar
- $_Scalar
- $Scalar1
- $Sca_lar
print 12e-02;
- 0.12
- 12
- 120
- 0.012
SAS programs have basically 2 steps .They are
- Base SAS
- DATA
- Macro
- PROC
A SAS program may contain a DATA step embedded within a PROC STEP and viceversa
- True
- False
SAS Statements – Usually begins with a keyword, always ends with a colon and are free format
- True
- False
Each time a step is executed, SAS software generates a log of the processing activities and the results of the processing.Separate sets of messages for each step in the program are produced.
- True
- False
Each time a step is executed, SAS software generates a log of the processing activities and the results of the processing.Separate sets of messages for each step in the program are produced.
- True
- False
Data Example2; Set Example1; Run; Proc Print Data = Example2; run; Here Proc step is executed first as Proc step always takes precedence in SAS .
- True
- False
Data Example2; Set Example1; Run; Proc Print Data = Example2; run; Here Proc step is executed first as Proc step always takes precedence in SAS .
- True
- False
In SAS log there are lines displayed with NOTE: ERROR: and WARNING:
- True
- False
In SAS log lines displayed with NOTE: contains
- Error messages
- Number of observations
- Usage of CPU in seconds
- Number of variables
The output created by the DATA step are
- Means Reports
- SAS Datasets
- Frequency Reports
- SAS Files
Some of the PROCs present in SAS are
- SUM
- MEANS
- FREQ
- DATASET
In Java, all non-static methods are by default "virtual functions." Only methods marked with the keyword final are non-virtual.
- True
- False
Which is the correct statement: a.) ODS HTML FILE = ‘file’; b.) ODS FILE HTML = ‘file’ c.) ODS FILE = ‘file’ d.) ODS HTML = ‘file’
- c
- b
- a
- d
Which ODS command closes the HTML file
- ODS HTML; CLOSE;
- ODS HTML CLOSE;
- ODS; HTML CLOSE;
- ODS CLOSE HTML;
data temp; set lib1.x lib2.y; length jobcode $12.; run; What would be the length of Jobcode in temp?
- 5
- 12
- 8
- Syntax error