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

Hello Friends, am new to this forum and am not good at sas progarmming. please can any one of you send me couple of sample large sample SAS Jobs which can you use 200 MB of data and other sas job upto 25GB of data. am doing a performance testing on our legacy systems and new upgraded system. I would really appreciate if you can do me this favor Thank you Priya

1345


How many ways to overcome a missing values???

2334


How would you define the end of a macro? : sas-macro

609


Name and describe few sas character functions that are used for data cleaning in brief.

663


If a variable contains only numbers, can it be a character data type?

610






What is a method to debug and test your SAS program?

715


how can you put a "trace" in your program? : Sas programming

575


What is the use of divide function?

600


How does SAS handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, PROCs?

1096


What is a put statement?

660


How do you connect the desktop application to metadata server? : sas-grid-administration

580


if the Id has more then two transcatiion then show the first observation, IF Id has only two observation then It show both the observation

1165


Explain append procedure?

631


Can you execute macro within another macro? If so, how would sas know where the current macro ended and the new one began? : sas-macro

696


What is the command used to find missing values?

591