Thursday, 18 May 2017

SAS Question and Answers to understand basics

Q. How does sas know on which server the piece of code to be executed ? say if a proc olap code is written then how the sas application would detect on which server to execute.

A.All Request are routed via Metadata Server. So, Metadata 
Server decides on the based of request to route the reqest 
accordingly to the apporpriate server


Q. What is SAS Information Map Studio and its purpose ?
SAS Information Map Studio is the Component where we can create the Information Maps using Tables and as well Cubes.
It acts like a middle layer for SAS Web Report Studio /SAS OLAP Viewer and SAS BI Dashboard.

If i want to Create a Report in SAS Web Report Studio i have to Create a Information Map and there i select my required dimensions and measures aswell filters.

After that i will login into my Web Report studio and there i will create my Report using this info map.


Q.what are different type of sas servers ? On which server does the sas code execute ?
SAS Metadata server
==========================
Which performs authentication and lets you to log into the 
system.

SAS Object spawner
=============================
Which initiates a new WORK space server if you start doing 
any activity.

SAS Workspace server
================================
Which performs code execution


****************
Optional servers
****************

Stored process server-------To create & execute stored 
processs
OLAP server-----------------To create and analyze cubes
SPDS------------------------Parallel processing

*********
JAVA servers (This to bring up Web clents like WRS, OLAP 
viewer...etc)
**********

Application server (Example Weblogic)
Web server (optional-- Example Apache)
WEBDAV server( Example---Xythos)




Q. what is incremental update ? is this possible in SAS OLAP CUBE STUDIO.
Incremental data means day to day transactions data

Example: we have already 10 days of Bank transactional data 
in our database on 11Th day some transactions are happened 
in the bank, this 11Th day data called Incremental data .If 
we are conducting our operations only on the 11th day data 
it is called Incremental update.

Q.HOW DO WE CREATE A SAS STORED PROCESS IN SAS EG ?
We can Create a Stored Process in EG.
Select a New Program from the EG File menu and add the code whatever u want (Should follow SAS Syntaxes) in that and after that right click and select create New stored Process.
After that in the wizard it will ask to select the stored process server and also add the parameters at Prompts wizard if u need.


Q. what is SAS ACCESS AND SAS CONNECT ? Give an example and data statements used.
SAS/CONNECT software is a SAS client/server toolset that 
provides scalability
through parallel SAS processing. SAS/CONNECT provides users 
and applications
developers the ability to manage, access, and process data 
in a distributed and parallel
environment
SAS/ACCESS engines provide seamless and transparent 
read/write/update access to more than 60 data sources, 
including relational and nonrelational databases


Q. How many versions came upto now in SAS?
SAS VERSIONS so far released in market:
(OLD VERSIONS)
V4
V5
V6
V6.08 (includes OLAP & SAS/STAT)
V6.12 
(NEW VERSIONS)
V7, V8, V8.1, V8.2
V9.0, V9.1, V9.1.2, V9.1.3, V9.2
V9.2.1 (recently launched)

Q What are symbol tables?Differemce between Local N Global Symbol tables.
Symbol table is save the Macro varibale list.
Local symobl table save the local macro varibale & 
Global symbol table save the global macro varibale.
Macro variables are stored in symbol tables, which list the 
macro variable name and its value. There is a global symbol 
table, which stores all global macro variables. Local macro 
variables are stored in a local symbol table that is 
created at the beginning of the execution of a macro.

Q. In which format does Date stores in sas..? What is the use of DATE in SAS.?
SAS represents a date internally as the number of days
between January 1, 1960 and the specified date. Dates
before 1960 are represented with negative numbers. A
SAS date value is a numeric variable
In SAS the date has been stored as machine level language,
and the reference date for SAS is Jan 1, 1960.
To find out the exp of employees we have to use DOJ, then we
will use date.
it is stored as numeric values.
Eg 
data aaa;
a=today();
put a;
run;
it will show you numeric no equivalent to current date.After using format staement u can get todays date as;
data aaa;
a=today();
format a date9.;
put a;
run;


Q. One way of creating a new variable in Macros is by % Let....What is the other way..?
1) %macro <macroname> ( );
%mend (<macroname>;

a DATA step that contains a SYMPUT routine within a macro
definition
a DATA step that contains a SYMPUTX routine within a macro
definition

a SELECT statement that contains an INTO clause in PROC SQL
within a macro
definition
a %LOCAL statement.
%global statement

In addition to the %LET statement, other features of the macro language that create macro variables are
iterative %DO statement
%GLOBAL statement
%INPUT statement
INTO clause of the SELECT statement in SQL
%LOCAL statement
%MACRO statement
SYMPUT routine and SYMPUTN routine in SCL
%WINDOW statement.


Q. What are the functions done while Compilation...?
first of all data will be available on input stack...Once program reaches the input stack,SAS transforms the stream of characters into indivdual tokens..these tokens are transferred into diffrent parts of SAS for processing such as datastep compiler and the macro processor...The process that SAS uses to extract words and symbols from the input stack is called TOKENIZATION .Tokenization is performed by a compnent of SAS called WORD SCANNER..The word scanner starts the first character in the input stack and examines each character in turn..then it will be analysed by datastep compiler untill it reaches the end of the datastep(run statement)..data step compiler and SCL compiler transforms this output into DISPLAY MANAGER...

Q. What is Tabulate.?Why we use it.? Which type of output we get from Tabulate.?
PROC TABULATE is a procedure used to display descriptive 
statistics in tabular format. 

It computes many statistics that are computed by other 
procedures, such as MEANS, FREQ, and REPORT. 

PROC TABULATE then displays the results of these statistics 
in a table format. 

TABULATE will produce tables in up to three dimensions and 
allows, within each dimension, multiple variables to be 
reported one after another hierarchically.

PROC TABULATE has some very nice mechanisms that can be 
used to label and format the variables and the statistics 
produced.

Q. What is difference between Global n Local Macro Variables..?
Two types of scopes exist for macro variables: global and 
local. Global macro variables exist for the duration of the 
SAS session and can be referenced anywhere in the program--
either inside or outside a macro. Local macro variables 
exist only during the execution of the macro in which the 
variables are created and have no meaning outside the 
defining macro.

Global macro variables can be used anywhere in the program,
whereas Local macro variable can be used within that macro only.

Global macro variable can be created and used anywhere in
the application and global macro variable value stores in
global symbol tables

Local macro variable can be created and used only inside of
the macro block and local macro variable value stores in
local symbol tables

Q. How to get second top scorer student from a class- table having different sections A, B, C & D? each section has same number of student.

proc sql;
select max(score) < (select max(score) from table)

from table;
quit;





No comments:

Post a Comment