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...

КОМЕНТАРІ • 35

  • @rajutelagareddi2036
    @rajutelagareddi2036 3 роки тому +4

    great brother........... i have no words to appreciate your explanation

    • @learnerea
      @learnerea  2 роки тому

      Thank you so much 😀

  • @meghajain4544
    @meghajain4544 2 роки тому +2

    Hey you have explained very easily.
    U have used good approach.
    To the point and relevant.
    Fantastic way

    • @learnerea
      @learnerea  2 роки тому

      Glad you liked it 👏

  • @TheYi1985
    @TheYi1985 10 місяців тому +1

    Fantastic !

    • @learnerea
      @learnerea  10 місяців тому

      Glad you like it!

  • @musicophile4342
    @musicophile4342 Рік тому +1

    Thank you sir.. Good explanation 👍

  • @arorajaonah8830
    @arorajaonah8830 Рік тому +1

    God bless you man ❤

  • @nd4763
    @nd4763 3 роки тому +1

    Great explanation. Thanks a lot

    • @learnerea
      @learnerea  2 роки тому

      Glad you liked it 👏

  • @ajaykushwaha-je6mw
    @ajaykushwaha-je6mw 2 роки тому +1

    Salute you Sir.

  • @narendervatsavai3662
    @narendervatsavai3662 2 роки тому +1

    Super explanation sir.........

  • @Dreamgardener747
    @Dreamgardener747 Рік тому +1

    Thank you so much!!

  • @syedabushra4662
    @syedabushra4662 2 роки тому +1

    Nicely explained

  • @ajaykushwaha4233
    @ajaykushwaha4233 2 роки тому +1

    Such a great video, why don’t you create video on SDTM and on AdAM.

  • @yuanzhou3249
    @yuanzhou3249 Рік тому +2

    where is this "trans" dataset? Thanks!

  • @mrinmoydas2351
    @mrinmoydas2351 Рік тому

    How to get last 2 trxn details of each Customer_name?

    • @learnerea
      @learnerea  Рік тому

      First sort the data in descending order and then use the same technique to create counter variable and the pick those where counter

  • @rohitwalopkar6953
    @rohitwalopkar6953 2 роки тому +1

    Can we use functions like mean , sum in after then statement?

    • @learnerea
      @learnerea  2 роки тому

      While you are summarising

  • @roshan6503
    @roshan6503 2 роки тому

    Can we use proc rank to create counter?

  • @chinthamahesh4561
    @chinthamahesh4561 3 роки тому +1

    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;

    • @learnerea
      @learnerea  3 роки тому +2

      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;

    • @chinthamahesh4561
      @chinthamahesh4561 3 роки тому +1

      @@learnerea thank you sir, its working

    • @rajutelagareddi2036
      @rajutelagareddi2036 3 роки тому

      @@learnerea sir what & do here

    • @sureshnarayasamy89
      @sureshnarayasamy89 3 роки тому +2

      @@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 ..

  • @rusdianto268
    @rusdianto268 3 роки тому +1

    Can we do this in proc sql?

    • @learnerea
      @learnerea  2 роки тому

      You can use row number partition by in SQL and not in Proc SQL

  • @ashutoshlatoriya7363
    @ashutoshlatoriya7363 3 роки тому

    Sir when I am practicing this the count variable is not getting created
    Why is it ??

    • @learnerea
      @learnerea  3 роки тому

      Please put your syntax here so that we could review that