First.Variable and Last.Variable in SAS | First. and Last. Processing in PDV
Вставка
- Опубліковано 18 вер 2024
- This video provides a comprehensive explanation of First.Variable and Last.Variable including the PDV processing. after watching this video you will be able to:
► Create an incremental counter based on the value of by variable
► Explain the First.Variable and Last.Variable processing in PDV
► Subset/Fetch the Nth observation from a dataset
► Calculate cumulative sum for each value in by variable
► Calculate subtotal/total for by variable
#Learnerea
#SASTraining #SASTutorial #SASCourse #SASTutorialForBeginners #SAS #SASforBeginners
#SASProgramming #SASTProgrammingForBeginners #SASProgrammingTutorial
Contacts:
Facebook ► / learnerea
Download the excel files for practice data
GitHub ► github.com/LEA...
great brother........... i have no words to appreciate your explanation
Thank you so much 😀
Hey you have explained very easily.
U have used good approach.
To the point and relevant.
Fantastic way
Glad you liked it 👏
Fantastic !
Glad you like it!
Thank you sir.. Good explanation 👍
God bless you man ❤
Great explanation. Thanks a lot
Glad you liked it 👏
Salute you Sir.
Super explanation sir.........
Thanks and welcome
Thank you so much!!
Glad it helped!
Nicely explained
Thank you
Such a great video, why don’t you create video on SDTM and on AdAM.
where is this "trans" dataset? Thanks!
How to get last 2 trxn details of each Customer_name?
First sort the data in descending order and then use the same technique to create counter variable and the pick those where counter
Can we use functions like mean , sum in after then statement?
While you are summarising
Can we use proc rank to create counter?
Hi sir, I have a doubt, can u tell me how to read?
Data a;
Input name$ salary age;
Datalines;
mani 2300 24
Anil 2500 45
Maheshmani 3000 28
Mahesh chintha 4200 30
;
Run;
Hi Chintha,
Interesting.
Just use some extra space to separate the values as in the last observation you want to keep first and last name in one variable which have one space in between them. and use an ampersand in the Input statement with name variable. see below e.g. -
Data a;
Input name & $20. salary age;
Datalines;
mani 2300 24
Anil 2500 45
Maheshmani 3000 28
Mahesh chintha 4200 30
;
Run;
@@learnerea thank you sir, its working
@@learnerea sir what & do here
@@rajutelagareddi2036, Normally char values read only 8 characters long by default , sometime the values of the char exceeds 8 , so we use the char length like positionally $1-20 or in length $20. but these won't work properly if there is a space in the variable value . in our case can't be read properly with $1-20 or in length $20. because it won't take spaces .
so , if you put '&' in the beginning like & $20. This means it will considers space even two or more spaces .
even if your values is , & $20 this will work ..
Can we do this in proc sql?
You can use row number partition by in SQL and not in Proc SQL
Sir when I am practicing this the count variable is not getting created
Why is it ??
Please put your syntax here so that we could review that