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

How to write duplicate records into a separate dataset using sort?

4 Answers   HSBC,


if a variable contain dates like "2015/01"---"2015/12" (yymm) ,How to add day to those dates,if them month is jan then 31 if the month is feb then 28 so on ...

0 Answers   Accenture,


how to debug and test the sas program? : Sas-administrator

0 Answers  


What are the data types that sas contain?

0 Answers  


what r the job openings SAS for fresher graduates !

0 Answers   TetraSoft, Wipro,






If money were no object, what would you like to do?

0 Answers   Oracle,


What are the default statistics that proc means produce?

0 Answers  


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,


Mention what are the data types does SAS contain?

0 Answers  


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

7 Answers   TCS,


describe the interaction table in sas di? : Sas-di

0 Answers  


explain the difference between alternate key, business key, foreign key, generated key, primary key, retained key and surrogate key ? : Sas-di

0 Answers  


Categories