NUMERIC FUNCTIONS IN SAS | SAS TUTORIAL FOR BEGINNERS VIDEOS 8

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 21

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

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

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

    romba thanks mam

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

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

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

    Pls try to do classes in teluguu

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

    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  3 роки тому

      Dear Rajat always placed format step immediate after data step

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

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

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

      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 3 роки тому

      @@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 2 роки тому

    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  2 роки тому

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

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

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

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

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

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

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

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

      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.

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

    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  2 роки тому +1

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

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

      @@Trenovision i understood

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

    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  3 роки тому +1

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