pratik kumar singh


{ City } noida
< Country > india
* Profession * systems engineer
User No # 106186
Total Questions Posted # 0
Total Answers Posted # 7

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 25
Users Marked my Answers as Wrong # 0
Questions / { pratik kumar singh }
Questions Answers Category Views Company eMail




Answers / { pratik kumar singh }

Question { 15804 }

If reading a variable length file with fixed input, how
would you prevent SAS from reading the next record if the
last variable didn?t have a value?


Answer

www2.sas.com/proceedings/sugi26/p009-26.pdf

The best document I have read on this topic.It takes into account both Column Input and List Input.Along with it conditions of Missing value and Short Value are also beautifully explained.

Is This Answer Correct ?    0 Yes 0 No

Question { 22627 }

Does SAS ?Translate? (compile) or does it ?Interpret?? Explain.


Answer

There are hell lot of differences between a Compiler and an Interpreter.But the two which I would take to prove that SAS actually COMPILES and is not Interpreted are:

1)A Compiler takes entire program as input while an interpreter takes single instruction as input.

SAS is a compiler as it does not read and execute one statement at a time. It will either wait for a RUN, QUIT, next DATA or PROC statement before executing its statements.

2)In compiler errors are displayed after entire program is checked.While in interpreter it is displayed for every instruction interpreted.

In SAS all errors are displayed after checking the particular data/proc step.

Is This Answer Correct ?    0 Yes 0 No


Question { 9379 }

At compile time when a SAS data set is read, what items are
created?


Answer

An input buffer is only created when data is read from external files/datalines not in case of reading data step.So the appropriate answer will be just PDV and Dataset Descriptor.

Is This Answer Correct ?    1 Yes 0 No

Question { 18669 }

Name statements that are recognized at compile time only?


Answer

Apart from doing numerous tasks during the compilation phase..
SAS also processes statements which are limited to compile time.These statements provide information to the compiler as to how the things will be set up in the PDV.they include
drop keep rename retain array by where attrib length format label.it also sets up automatic variables:
_N_ _ERROR_ IN= END= POINT= FIRST. LAST.

Is This Answer Correct ?    0 Yes 0 No

Question { 22259 }

Identify statements whose placement in the DATA step is
critical?


Answer

The placement of drop keep and rename statement does not affect its execution order.The order is fixed in the order
DROP-KEEP-RENAME.Even if you put a rename statement(rename old_var=new_var;) before a drop statement.The drop statement will look for old_var as it is executed prior to rename statement.
Length can be the answer as its placement is very important.Changing the length value of a variable after the set statement will not carry out the necessary change.It has to be done before set statement.

Is This Answer Correct ?    3 Yes 0 No

Question { HSBC, 8698 }

if reading an external file to produce an external file, what
is the shortcut to write that record without coding every
single variable on the record


Answer

proc import
datafile='D:\Dropbox\SAS\testfile1.txt'
out=data_imported dbms=dlm replace;
getnames=NO;
run;

proc export
data=data_imported
outfile='D:\Dropbox\SAS\testfile2.txt' replace;
run;

Is This Answer Correct ?    7 Yes 0 No

Question { HSBC, 10888 }

what is the difference between x=substr(name,1,2);
and substr(name,1,2)='x';


Answer

I agree with the first answer just a change is .it will be
"x ttwik" rather than "xttwik" as the replacement happens from the first loacation not as a whole.

Is This Answer Correct ?    14 Yes 0 No