NUMERIC FUNCTIONS IN SAS | SAS TUTORIAL FOR BEGINNERS VIDEOS 8

Sdílet
Vložit
  • čas přidán 21. 08. 2024
  • SAS has a wide variety of in built functions which help in analysing and processing the data. These functions are used as part of the DATA statements. They take the data variables as arguments and return the result which is stored into another variable. Depending on the type of function, the number of arguments it takes can vary. Some functions accept zero arguments while some other accept fixed number of variables. Below is a list of types of functions SAS provides.

Komentáře • 21

  • @rajashekar5755
    @rajashekar5755 Před 3 lety

    romba thanks mam

  • @sandysandeep6411
    @sandysandeep6411 Před rokem

    everything is good, but yawning in between the video is not okay!! 😇

  • @ayoenzo8536
    @ayoenzo8536 Před 11 měsíci

    Hello ma’am, may I request for the notes or a textbook used in this course?

  • @ammuluammulu3764
    @ammuluammulu3764 Před 2 lety

    Pls try to do classes in teluguu

  • @RajatMadaanmaddy
    @RajatMadaanmaddy Před 3 lety

    mam i have one question , i used month=month(date) function to get the month value and it returns value from 1-12 representing each month. i want to print these 1-12 values as months like jan feb by using a inbuilt format monname. , but when i am using it its only printing January for each value. how can i resolve this.
    here is the code.
    data med;
    date=today();
    day=weekday(date);
    month=month(date);
    format month monname. day Downame.; ------ in output only january is getting printed-----
    run;

    • @Trenovision
      @Trenovision  Před 3 lety

      Dear Rajat always placed format step immediate after data step

    • @RajatMadaanmaddy
      @RajatMadaanmaddy Před 3 lety

      @@Trenovision in proc step also .. it's same issue. Only January is getting printed

    • @Trenovision
      @Trenovision  Před 3 lety

      Dear Rajat date, month and day formats can be applied only to the date type values but if you see your code day n month don't have date type values. You can try any of below codes to get the desired output.
      data med;
      format date date9. month monname. day Downame.;
      date=today();
      day=today();
      month=today();
      run;
      or
      data med;
      format date date9. month monname. day Downame.;
      date=today();
      day=date;
      month=date;
      run;
      or you want to do your way then you can define values by using proc format.

    • @RajatMadaanmaddy
      @RajatMadaanmaddy Před 3 lety

      @@Trenovision thank you mam i got your point ,,, its kind of confusing actually , that i am able to print weekday information by downame. fornmat but when i am trying the monname. on month=month(); its printing january only. issue is resolved if i used monname. on date

  • @TheVaibhavdang
    @TheVaibhavdang Před 2 lety

    How to find the position of 2 blank spaces in the dataset?
    datalines;
    kamireddy jagan Reddy
    adithya desh pandey
    rajat kumar madaan
    julee bharatkumar thanki
    ;
    run;

    • @Trenovision
      @Trenovision  Před 2 lety

      Use index() function to find 2 blank spaces it will return the position.

    • @TheVaibhavdang
      @TheVaibhavdang Před 2 lety

      @@Trenovision I tried that but unable to find the exact result. Can you provide the solution for the same?

    • @Trenovision
      @Trenovision  Před 2 lety

      @@TheVaibhavdang You can also use scan() function if you're trying to extract first, middle and last name.

    • @TheVaibhavdang
      @TheVaibhavdang Před 2 lety

      @@Trenovision Thats the thing but I just want to find the second blank right now,so that I can perform multiple operations

    • @Trenovision
      @Trenovision  Před 2 lety

      You can refer this to solve your issue.
      blogs.sas.com/content/sgf/2019/06/26/finding-n-th-instance-of-a-substring-within-a-string/#:~:text=Here%20is%20how%20you%20can,1%20from%20right%20to%20left.

  • @RajatMadaanmaddy
    @RajatMadaanmaddy Před 3 lety

    data Name;
    input Fname $ 30.;
    a=propcase(Fname);
    d=substr(a,index(a,' '),length(a));
    newVar=substr(a,1,1)||'.'||d;
    drop a d;
    datalines;
    kamireddy jagan Reddy
    adithya desh pandey
    rajat kumar madaan
    julee bharatkumar thanki
    ;
    run;
    proc contents data=name;
    run;
    i created this program before checking your solution ,, i could not reduced NewVar length from 61. you said max should be 50.

    • @Trenovision
      @Trenovision  Před 3 lety +1

      Try this to reduce default length of newly created variable.
      DATA NAME;
      FORMAT NEWVAR $50.;
      INPUT FNAME $30.;

  • @ramesh8275
    @ramesh8275 Před 2 lety

    madam, i have one question.
    how do i total in a particular column(Variable) ?
    e.g=
    data mka;
    input pid$ sp1-sp10;
    cards;
    Ab 23 45 65 74 85 96 12 42 62 85
    cd 25 32 45 70 20 60 32 45 15 65
    ef 02 32 12 45 65 95 75 85 25 15
    gh 45 65 15 75 42 62 21 26 58 69
    ik 58 65 45 85 96 45 12 20 30 40
    ;
    run;

    • @Trenovision
      @Trenovision  Před 2 lety +1

      We didn't get your question, you can sum using aggregation in proc sql for a particular column.

    • @ramesh8275
      @ramesh8275 Před 2 lety

      @@Trenovision i understood