| Back to Questions Page |
| |
| Question |
Whats the difference between $, $$, $$$ |
Rank |
Answer Posted By |
|
Question Submitted By :: Purva |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | $--- single doollar is system defiend variables
$$--- double dollar is user defined variabes
$$$--- No idea....(just send me if u know)  |
| Praveen Kumar Pendekanti |
| |
| |
| Answer | $ - These are the system variables like $Bad file,$input
file, $output file, $DB connection
$$ - Can any one tell me the scenario with example for
user defined variables
$$$ - $$$SessStartTime
$$$SessStartTime returns the initial system date value on
the machine hosting the PowerCenter Server when the server
initializes a session. $$$SessStartTime returns the session
start time as a string value. The format of the string
depends on the database you are using.
Thank You  |
| Purva |
| |
| |
| Answer | $$ - is used for Parameter...see the below example
select a,b,c from <table> where <table>.date-$$date_filter
when you define parameter file in the src File directory
and this should be given in session, if in parameter file
if you give 10, then above query will be as below
select a,b,c from <table> where <table>.date-10  |
| Gopal |
| |
| |
|
|
| |
| Answer | $ - session variable
$$ - mapping parameter & variable
$$$ - system variable  |
| Abidu |
| |
| |
| Answer | Mr.purva is corrct,good going  |
| Frnd |
| |
| |
| Question |
What is _n_? |
Rank |
Answer Posted By |
|
Question Submitted By :: Jaipal Reddy |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | This is a data counter variable used in SAS.
..Raghu  |
| Raghu |
| |
| |
| Answer | this option is used to pick up n number of observation from
particular dataset  |
| Hymad |
| |
| |
| Answer | The value of _N_ represents the number of times the DATA
step has iterated  |
| Sru |
| |
| |
| Answer | it is a automatic variable.it displayed at which line the
error is occur  |
| Brajesh |
| |
| |
| Answer | it is a automatic variable.it counts the no. of line and
displays at which line errors are occur  |
| Mohini |
| |
| |
| Answer | This is nothing but a implict variable created by SAS during
data processing. It gives the total number of records SAS
has iterated in a dataset. It is Available only for data
step and not for procs.
Eg. If we want to find every third record in a Dataset then
we can use the _n_ as follows
Data new-sas-data-set;
Set old;
if mod(_n_,3)= 1 then;
run;
Note: If we use a where clause to subset the _n_ will not
yield the required result.  |
| Ravi |
| |
| |
| Answer | This is an automatic variable. It is used to count the
number of obs in dataset.Its added one for every iteration
of datastep.  |
| Ashok Kore |
| |
| |
| Answer | it indicates number of observations.  |
| Sirisha |
| |
| |
| Answer | its an automatic variable.it shows no. of iterations gone
through in datastep  |
| Yuva |
| |
| |
| Answer | _ n_ give no.of times data step is itereated .it gives
correct observations nos only if IF SUBSET IS NOT USED in
the datastep  |
| Vijaibhaskar |
| |
| |
| Answer | _n_ is a automatic variable created by SAS.we can use this
like we use any variable that we created ourselfs and it
indicates the number of times SAS has looped through the
data step.  |
| Madhavi |
| |
| |
| Answer | Number of errers during excution time  |
| Rams |
| |
| |
| Answer | SAS variable to count the no of obs read.  |
| D.vijaya Bhaskar |
| |
| |
| Answer | An internal SAS counter in the data step which contains the
current iteration number of the data step.  |
| Natraj Boga |
| |
| |
| Answer | IT IS AUTOMATIC VARIABLE SHOWS NUMBER OF ITERATIONS.  |
| Arun |
| |
| |
| Answer | Almost all the above answers are right, except one or few.
Here I provide a clear insight into _n_ variable. This is an
automatic variable of PDV(Program Data Vector) that returns
the no. of observations that it has iterated. There are
such variables like _error_, end=, in=, first.by-variabke,
last.by-variable,etc.. All these variables will not be
displayed in the target output.
Ex:
data new;
set ora.emp;
if _n_ >= 2 and _n_ <= 6 then output;
run;
/* as _n_ returns 'n'th observation our statement is to save
those obs when _n_ returns the value between 2 and 6. Hence
the 5 obs of the specified dataset between second and six
are saved into 'new'.  |
| Cutepa1 |
| |
| |
| Answer | _n_ is a automatic variable the function of _n_ is how many
times the data step begins to execute.  |
| Suresh B Anisetty |
| |
| |
| Answer | The _n_ is a automatic variable which displays the line number.  |
| Chiranjeevi |
| |
| |
| Question |
In the flow of DATA step processing, what is the first
action in a typical DATA Step? |
Rank |
Answer Posted By |
|
Question Submitted By :: Jaipal Reddy |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | When you submit a DATA step, SAS processes the DATA step and
then creates a new SAS data set
Compilation Phase
Execution Phase  |
| Ravi |
| |
| |
| Answer | creation of input buffer and PDV  |
| Mallikarjuna Reddy |
| |
| |
| Answer | 1)Compilation Phase
When you submit a DATA step,it reads the input statements
it creates an input buffer and brings the variables and
observations.it is a logical memory area.
and pdv brings the observations at a time from input buffer
and checks the errors.
PDV contains 2 automatic variables _n_ & _error_ ,these
checks the erros in observations.
_n_ : indicates the no of obs.
_error_: 1 if error occured
0 if no error
After that it assigns the datavalues to appropriate
variable and build a sas dataset.
2)Execution Phase  |
| Latha Reddy |
| |
| |
| Answer | SAS CHECKS FOR SYNTAX ERRORS  |
| Srinivas |
| |
| |
| Answer | Compilation phase happens first in data step processing.
during compilation phase, each statement is scanned for
syntax errors.  |
| Kiran |
| |
| |
| Question |
Name statements that are execution only. |
Rank |
Answer Posted By |
|
Question Submitted By :: Jaipal Reddy |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | proc print data=datasetname; run;  |
| Daya |
| |
| |
| Answer | run;
It is the execution statement  |
| Ravi |
| |
| |
| Answer | run;  |
| Siri |
| |
| |
| Answer | wen we r using proc sql tat time
quit; is execution statement  |
| Yuva |
| |
| |
| Answer | infile,input,sum statament etc.  |
| Vanna.mallikarjunareddy |
| |
| |
| Answer | The conditional statements IF-THEN/ELSE and theloop
statements DO UNTIL nad DO WHILE all are execution time
statements only  |
| Suresh B Anisetty |
| |
| |
| Answer | there many execution statements,some of them are
DATA
INPUT
CARDS
INFILE
WHERE
LABEL
SELECT
INFORMAT
FORMAT and the list goes.  |
| Srilatha |
| |
| |
| Answer | execution statements are
INPUT
CARDS
INFILE
WHERE
LABEL
SELECT
INFORMAT
FORMAT and the list goes  |
| Narasimharao |
| |
| |
| Question |
Name statements that function at both compile and execution
time. |
Rank |
Answer Posted By |
|
Question Submitted By :: Jaipal Reddy |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | DATA is the statement that function at both compile and
execution time.  |
| Radhika |
| |
| |
| Answer | keep and drop statements identifies at both compile and
execution time.  |
| Ganesh |
| |
| |
| Answer | only FORMAT statement  |
| Suresh B Anisetty |
| |
| |
| Question |
Identify statements whose placement in the DATA step is
critical. |
Rank |
Answer Posted By |
|
Question Submitted By :: Jaipal Reddy |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Data and run statement.  |
| Payal |
| |
| |
| Answer | Input statement  |
| Madhu |
| |
| |
| Answer | DATA STATEMENT  |
| Rakesh |
| |
| |
| Answer | LENGTH statement and
defining GLOBAL variable in MACRO  |
| Sandhya |
| |
| |
| Question |
Name statements that are recognized at compile time only? |
Rank |
Answer Posted By |
|
Question Submitted By :: Jaipal Reddy |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | FORMAT statement  |
| Nipun |
| |
| |
| Answer | retain,input,infile,informat,format etc.  |
| Mallikarjuna Reddy.vanna |
| |
| |
| Answer | All compile time activities are un-conditions only exists
at execution time.
LABEL,KEEP,DROP,RENAME,LENGTH,FORMAT,INFORMAT,ATTRIB,BY,WHER
E and ARRAY are all compile time only statements, however
LABEL is the statement that can be place any where with in
the DATA step  |
| Suresh B Anisetty |
| |
| |
| Question |
At compile time when a SAS data set is read, what items are
created? |
Rank |
Answer Posted By |
|
Question Submitted By :: Jaipal Reddy |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | _N_ and _error_ items are created at compile time for each
and every iteration of sas dataset that is being created.  |
| Swathi |
| |
| |
| Answer | only PDV is generated at compilation time, where as _N_
_ERROR_ are generated at execution time only.  |
| Mallikarjuna Reddy |
| |
| |
| Answer | PDV and Input buffers are created at compile time . and
_n_,_error_ were created at compile time  |
| Thanwi |
| |
| |
| Answer | At Compile time SAS creates
1.Input buffer
2.PDV(Program data vector)
3.Descriptor portion of the o/p dataset  |
| Madhavi |
| |
| |
| Answer | At compile time when a sas dataset is read it creates two
things only.
1)Programm data vector.
2)discriptive protion.  |
| Ganesh |
| |
| |
| Answer | when the sas dataset read pdv will create.input buffer
creates only at the time of reading raw datafile.at the
time of creation of pdv --data portion ,and discripter
portion created.at this time data will read and start the
iteration of the data step .at the same time _n _ and
_error_ are created.  |
| Ch .sumalatha |
| |
| |
| Answer | At compile time it creates input buffer,program data vector
and discription portion.
Input buffer is the temporary storage of memory with
variable length.
Pdv is storages lists of system defined var's and user
defined var's.
Discription portion contains details like when data set is
created, date , time , no of var's and no of obs etc.  |
| Madhu |
| |
| |
| Answer | SAS compiles the code• At compile time when a SAS data set
is read, what items are created?Automatic variables are
created. Input Buffer, PDV and Descriptor Information•  |
| Chiranjeevi.p |
| |
| |
| Question |
Does SAS ‘Translate’ (compile) or does it ‘Interpret’? Explain. |
Rank |
Answer Posted By |
|
Question Submitted By :: Jaipal Reddy |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Compile  |
| Sheetal Jaju |
| |
| |
| Answer | compile is the right option.  |
| Ganesh |
| |
| |
| Answer | interpret  |
| Sirisha |
| |
| |
| Answer | complie. When you submit a DATA step for execution, SAS
checks the syntax of the SAS statements and compiles them,
that is, automatically translate the statements into
machine code.  |
| Juan |
| |
| |
| Question |
What is the Program Data Vector (PDV)? What are its functions? |
Rank |
Answer Posted By |
|
Question Submitted By :: Jaipal Reddy |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | PDV (Program Data Vector) is a logical area in memory where
SAS creates a dataset one observation at a time.  |
| Poornima |
| |
| |
| Answer | When SAS processes a data step it has two phases.
Compilation phase and execution phase.
During the compilation phase the input buffer is created to
hold a record from external file. After input buffer is
created the PDV is created. The PDV is the area of memory
where sas builds dataset, one observation at a time. The PDV
contains two automatic variables _N_ and _ERROR_.  |
| Nishant |
| |
| |
| Answer | To the above answers I like to add a bit of information that
PDV has even more automated variables such as
FIRST.<by-group-variable>, LAST.<by-group-variable>, _END_,
...etc, along with _ERROR_ and _N_ where each has got its
own significance to have a control over the execution of a
SAS Program.  |
| Cutepa1 |
| |
| |
| Answer | It is a logical area in memory where SAS builds a data set,
one observation at a time. When a program executes, SAS
reads data values from the input buffer or creates them by
executing SAS language statements. The data values are
assigned to the appropriate variables in the program data
vector. From here, SAS writes the values to a SAS data set
as a single observation.
Along with data set variables and computed variables, the
PDV contains two automatic variables, _N_ and _ERROR_. The
_N_ variable counts the number of times the DATA step
begins to iterate. The _ERROR_ variable signals the
occurrence of an error caused by the data during execution.
The value of _ERROR_ is either 0 (indicating no errors
exist), or 1 (indicating that one or more errors have
occurred). SAS does not write these variables to the output
data set.  |
| Raj |
| |
| |
| Question |
How would you code a merge that will write the matches of
both to one data set, the non-matches from the left-most
data set to a second data set, and the non-matches of the
right-most data set to a third data set. |
Rank |
Answer Posted By |
|
Question Submitted By :: Jaipal Reddy |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | this problem over come by using the joins statements  |
| Giri |
| |
| |
| Answer | data new1 new2 new3;
merge old1 (in=one) old2 (in=two);
if one and two then output new1;
else if one and not two then output new2;
else output new3;
run;  |
| Tangyoulei |
| |
| |
| Answer | data one;
input ID$ NAME$;
datalines;
A01 SUE
A02 TOM
A05 KAY
A10 JIM
;
RUN;
DATA TWO;
INPUT ID$ AGE SEX$;
DATALINES;
A01 58 F
A02 20 M
A04 47 F
A10 11 M
;
RUN;
DATA N1 N2 N3;
MERGE ONE (IN=X) TWO (IN=Y);
BY ID;
IF X=1 AND Y=1 THEN OUTPUT N1;
IF X=1 AND Y=0 THEN OUTPUT N2;
IF X=0 AND Y=1 THEN OUTPUT N3;
RUN;  |
| Arun & G.n.rao |
| |
| |
| Answer | proc sql;
create table both_match as
select *
from one
intersect
select *
from two;
create table left_non as
select *
from one
except
select *
from two;
create table right_non as
select *
from two
except
select *
from one;
quit;  |
| Vinod Swarna |
| |
| |
| Answer | The above proc sql is not working. it is throwing up error.
Please verify. If anybody give proc sql code for the above
question that would be great.
padma  |
| Padma |
| |
| |
| Answer | what is the error u r getting ?  |
| Vinod |
| |
| |
| Question |
How would you code a merge that will keep only the
observations that have matches from both sets. |
Rank |
Answer Posted By |
|
Question Submitted By :: Jaipal Reddy |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | Using "IN" variable option. Look at the following example.
data three;
merge one(in=x) two(in=y);
by id;
if x=1 and y=1;
run;  |
| Nishant |
| |
| |
| Answer | data three;
merge one(in=x) two(in=y);
by id;
if x and y;
run;  |
| Pallavi |
| |
| |
| Answer | Using joins in proc sql statement, see following example
proc sql;
select *
from a, b
where a.case_id = b.case_id;
quit;  |
| Sheetal |
| |
| |
| Answer | proc sort data=one;
by id;
run;
proc sort data=two;
by id;
run;
data comm_rec;
merge one(in=a) two(in=b);
by id;
if a and b;
run;
proc print data=comm_rec;
run;  |
| Madhavi |
| |
| |
| Answer | here we used simple answer ia
data merge;
merge(tables------);
by (same colum);
if e1 and e2 then
output;
keep-----;
run;  |
| Kamudu |
| |
| |
| Question |
How would you delete observations with duplicate keys? |
Rank |
Answer Posted By |
|
Question Submitted By :: Jaipal Reddy |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | using nodupkey  |
| Satish |
| |
| |
| Answer | Use nodupkey option in proc sort  |
| Nishant |
| |
| |
| Answer | or distinct in proc sql  |
| Tangyoulei |
| |
| |
| Answer | using Nodup you can delete duplicate observation  |
| Chirag Patel |
| |
| |
| Answer | use nodupkey in proc sort automatically the duplicate key
going to delete.  |
| Ganesh |
| |
| |
| Answer | There is stage called Remove Duplicate to delete duplicate
record and also Sort stage do same funtion.Otherwise if
source databse is a table,then in source SQL we can select
distinct value.  |
| Roopanwita |
| |
| |
| Answer | we can delete the observation by using NODUP.
proc sort data=name nodup;
by varname;
run;  |
| Ganesh |
| |
| |
| Answer | In data step first dot variable and last dot variable use
to delete the duplicate values.
by using no dup we delete the duplicate values in row wise
and no dup key is used to delete the duplicate values in
column wise it means observation
and distinct is use to delete the duplicate values in proc
sql  |
| Haritha |
| |
| |
| Answer | nodupkey  |
| Prakash |
| |
| |
| Answer | proc sort data= nodupkeys;
by variable;
run;  |
| Serena |
| |
| |
| Question |
How would you delete duplicate observations? |
Rank |
Answer Posted By |
|
Question Submitted By :: Jaipal Reddy |
| This Interview Question Asked @ Accenture , Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | we can delete duplicate observations by using nodup or
nodupkey option in the proc sort
Example :-
Proc sort data=datasetname nodup;
run;  |
| Poornima |
| |
| |
| Answer | use nodupkey, noduprec in sort processure  |
| Soniya |
| |
| |
| Answer | noduprecs  |
| Saritha |
| |
| |
| Answer | noduprecs  |
| Saritha |
| |
| |
| Answer | by using merge statement  |
| Vijay |
| |
| |
| Answer | using proc sort and by statements  |
| Raj |
| |
| |
| Answer | There are several ways to do this. However the easliest
code-wise is to use PROC SORT. For example:
PROC SORT DATA=mydata NODUPKEY;
BY variable;
RUN;  |
| Vijay |
| |
| |
| Answer | there 3 options to delete duplicate obs
1. nodup
2. nodupkey
3.noduprec
if a entire record is duplicated in sense we use nodup of
nodup rec in proc sort procedure.
proc sort data=dsn nodup/noduprec;
by var;
run;
if a variable is repeated not a entire record . this time
we use nodupkey
proc sort data=dsn nodupkey;
by var;
run;
ex; in a dataset empid is repeated then use this syn. and
the empid is used in by var statement.  |
| Srinivas |
| |
| |
| Question |
Code a PROC SORT on a data set containing State, District
and County as the primary variables, along with several
numeric variables. |
Rank |
Answer Posted By |
|
Question Submitted By :: Jaipal Reddy |
| This Interview Question Asked @ Accenture |
|
I also faced this Question!! |
© ALL Interview .com |
| Answer | data daya;
infile 'c:\country.txt';
input &state &district &country population total:
proc sort data=daya:
by state;
proc print data=daya;
run;  |
| Daya |
| |
| |
| Answer | data abc;
infile 'c:\country.txt';
input &state &district &country population total:
proc sort data=abc:
by state district country;
proc print data=abc;
run;  |
| Pallavi |
| |
| |
| Answer | data info;
infile 'C:\country.txt';
input $state $district $country population total;
proc sort data=info;
by state district country;
proc print data= info ;
run;  |
| Prakash |
| |
| |
| Answer | data code;
infile'C:\Documents and Settings\admin\Desktop\country.txt';
input state$ district$ county$ population total;
proc sort data=code out=count;
by state district county;
run;
proc print data=count;
run;  |
| Chiranjeevi |
| |
| |
| Answer | here some step has syntax errors lik in input statement its
mentioned as $ state and so but correct form is state $...  |
| Radhika Rakesh |
| |
| |
|
| |
|
Back to Questions Page |