What is LAG function?How is it used? can any one explain

Answer Posted / basha

hai gajari
this is basha from chennai no phones no mails why? what
happened man?
ok lets see answer

lag function returns value from que
ex:-
data gajari;
input chindhi 8. @@;
datalines;
1 2 3 4 5
;
run;
data rao;
set gajari;
chore=lag(chindhi);
run;

output:-
obs chndhi chore
1 1 .
2 2 1
3 3 2
4 4 3
5 5 4

ok bye
take care
basha
TVS F&S

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the statements that are executed only?

663


What are the data types that sas contain?

647


What are the 3 components in sas programming?

714


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

537


sas implementing companies in pune implementing clinical projects if anyone knows plz send ans immediately

3100






what is hierarchy flattening? : Sas-di

610


How to limit decimal places for variable using proc means?

580


What is the function of Stop statement in a SAS Program?

637


What is your favorite all time computer book? Why?

2039


Explain bmdp procedure?

601


Explain the purpose of retain statement.

584


hi tell be about pfizer? how to compare the work with other companies ? please tell me how to login and work also?

1654


Can you execute macro within another macro? : sas-macro

515


what is sas application server, database server, sas olap server and sas metadata server? : Sas-di

545


I have a dataset concat having variable a b & c. How to rename a b to e & f?

567