What is LOGICAL VARIABLES in SAS.And how it can be used..Can
anyone support..???

Answers were Sorted based on User's Feedback



What is LOGICAL VARIABLES in SAS.And how it can be used..Can anyone support..???..

Answer / sangeeta

Fitst. and Last. varibles used in data step are called
Logical Variables.

Is This Answer Correct ?    26 Yes 3 No

What is LOGICAL VARIABLES in SAS.And how it can be used..Can anyone support..???..

Answer / nagaraju

Fitst. and Last. varibles are logical variables and returns
1 & 0 values.
These are mailnly used to give the first and last
occurances from the table.

ex: employee table having (1-100 employees) -- uses

if we give first.empid=1 then it gives only first employee
details
if we give first.empid=0 then it gives remaining employee
details except first one

in the same way

if we give last.empid=1 then it gives last employee details
if we give last.empid=0 then it gives remaining employee
details except last one
hope this is clear

Is This Answer Correct ?    22 Yes 3 No

What is LOGICAL VARIABLES in SAS.And how it can be used..Can anyone support..???..

Answer / xxx

Yes I agree with the above answers,
first.obs and last.obs are also specifies the occurrence of the data. If we mention like
first.obs=1 and last.obs=1;
it will eliminate the duplicates also.

Is This Answer Correct ?    7 Yes 0 No

Post New Answer

More SAS Interview Questions

what is the difference between the SAS v8 and SAS v9?

7 Answers   TCS,


Mention few ways with which a “table lookup’ is done in sas programming.

1 Answers  


how to remove the duplicates by proc sql?

2 Answers   Genpact,


Will it bother you if the guy at the next desk times the frequency and duration of your bathroom or coffee breaks on the grounds that ?you are getting paid twice as much as he is??

0 Answers   Oracle,


Can anyone help me about SAS Realtime scenarios in Clinical field

0 Answers  






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

10 Answers  


When merging 2 datasets with a common variable (not merge key), how to keep both?

3 Answers  


What is the difference between an informat and a format? Name three informats or formats.

13 Answers   Accenture, IBM,


What is _n_?

23 Answers   Accenture,


Can you calculate the mean, median and mode of the following data set using data step logic? Don't use any function or procedure. data a; input age @@; datalines; 22 32 32 32 43 23 24 56 45 54 28 29 27 26 25 28 30 20 18 37 36 47 46 56 19 20 ; run; I have calculated the mean which i have posted in the answer section.

6 Answers   HSBC,


What was the last computer book you purchased? Why?

0 Answers   Oracle,


my problem is to export my report to xsl.i can do that.but the problem is my report has 3 headings first heading should be printed with the merging of (1-5)cells and heading 2 should be of merge(2-4)cells?how to do this condition?

2 Answers   Dr Reddys, Oracle,


Categories