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 can you create zero observation dataset? : Sas programming

0 Answers  


what is syntax of proc merge ?

7 Answers   TCS,


What is the difference between reading data from an external file and reading data from an existing data set?

0 Answers  


what are 5 ways to perform a table lookup in sas? : Sas-administrator

0 Answers  


how do u validate sas program

3 Answers   Accenture,






Explain what is SAS informats?

0 Answers  


i have multiple .csv files in a unix directory. every file is having variable names as header.even for empty file also. suppose take 3 files a.csv b.csv c.csv a.csv contains data as name;age,salary; raja;34;4000; ravi;33;5000; kumar;25;3000; b.csv contains data as name;age,salary; ajay;40;4500; and c.csv contains name;age,salary; (only headers) Now i want to import and append all these files in to a single dataset. i tried infile statement with *.csv to import all at a time. but i m not getting correct data. please help me . its urgent. thank you in advance

2 Answers   Tech Mahindra,


What is the order of evaluation of the following operators + - * / ** () ???

2 Answers  


What are the features of SAS?

0 Answers  


Explain the difference between using drop = data set option in set and data statement?

0 Answers  


Name statements that function at both compile and execution time.

7 Answers   Accenture,


Tell e how how dealt with..

0 Answers   Wipro,


Categories