SAS CHARACTER FUNCTIONS - 7|PERL REGULAR EXPRESSION in SAS|SEARCH FOR A VALUE PATTERN IN A VARIABLE

Поділитися
Вставка
  • Опубліковано 18 вер 2024
  • This video explains how you can use the PRXMATCH significantly to look for a PATTARN in a particular string/character variable.
    This shows you an interesting example to extract a pattern digits for a mobile number.
    If you want learn:
    ► HOW TO USE PRXMATCH IN SAS
    ► What is PERL EXPRESSION or PERL REGULAR EXPRESSION and how to use this
    ► HOW TO FIND THE OBSERVATIONS WHICH STARTS WITH, CONTAINS OR ENDS WITH SOMETHING
    ► HOW TO FIND A PATTERN OF VALUES IN A CHARACTER VARIABLE
    #Learnerea
    #SASTraining #SASTutorial #SASCourse #SASTutorialForBeginners #SAS #SASforBeginners
    #SASProgramming #SASTProgrammingForBeginners #SASProgrammingTutorial
    Contacts:
    Facebook ► / learnerea
    Download the excel files for data to practice:
    GitHub ► github.com/LEA...

КОМЕНТАРІ • 36

  • @afdd2-1.66
    @afdd2-1.66 3 роки тому +1

    Bravo, thanks man.

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

    Awesome video bro. You nailed it.

  • @akshayaseetharaman5687
    @akshayaseetharaman5687 9 місяців тому

    wonderfull presentation and example.

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

      Glad it was helpful

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

    Thanks sir

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

    Hey this helped me a lot! Very clearly explained thanks a lot!

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

    Keep upload more videos sir thank you

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

    if we have any special characters like , @ ! then which expression should we use.

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

      It depends what exactly you want, for example if you just want to look for strings which contains any of these characters you can simply put these characters between "/ /" as explained in the video e.g.
      prxmatch("/@/",text);
      it will be great if you can be more specific and provide an example along with problem statement

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

    Thank you for the lecture, very well explained. I have two questions on this subject and looking for an answer, could you please help? Thanks! really appreciated.
    1) Which perl regular expression can represent 5MQ, 5:MQ, 8MQ, or 8:MQ
    prxmatch('', x)
    2)Which perl regular expression can replace MOUSE with RAT in prxmatch?
    the choice are '\s\MOUSE\RAT', '\s\RAT\MOUSE', '
    \MOUSE\RAT', '
    \RAT\MOUSE'

  • @ganeshreddytammineni9059
    @ganeshreddytammineni9059 11 місяців тому

    Is there any other function similar to prxmatch.
    I have a condition like want extract dates present in the variable label

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

      Yes that can be solved. Can you elaborate your problem statement a bit more.. i.e. how does your input look like and what kind of output you are expecting.. and in what conext you are using this..
      it will help us give you a more specific solution

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

    How do I retrieve a substrings from a string using delimiters .
    Example : memoline cust 266 / 0,
    memoline cust 266 / 123 ,
    memoline cust266 / 0.00 and I wanna filter out all data with 0 or 0.00 after / .. stuck help pls

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

      Please find below:
      data testing;
      input variables $25.;
      datalines;
      memoline cust 266 / 0
      memoline cust 266 / 123
      memoline cust266 / 0.00
      ;
      run;
      data test;
      set testing;
      where compress(variables) like '%/0%';
      run;

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

      @@learnerea thankyou will try that

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

      @@learnerea thanks sir

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

    Hi could you please show how to convert from one delimeter to another

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

      Hi Laicy,
      To make it more clear, could you pleas put an example of your problem statement here, like what you have and how you want that to be converted

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

      @@learnerea For example I have one basic dataset, in that default delimeter will be comma, how do I convert that to star? Is there any direct method?

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

      @@laicythomas7380 Yes, I assume that the value is not some currency value which are separated by commas and it's character value then you can use TRANWRD function to directly replace whatever you want, for example, Try to use the below:
      name = tranwrd('Laicy, Thomas', ',' ,'*')
      for more clarity I recommend you to check out the video:
      ua-cam.com/video/xoJmyD2oBLg/v-deo.html
      let me know if this answers you question or not

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

      @@learnerea Okay, Thank you so much. I got it now.

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

      @@laicythomas7380 Happy to help ☺

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

    transaction data missing from your site

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

      my sincere apologies for that... however, you can try this technique on any sort of data... and it's more beneficial if you try to perform the taught technique on your choice of data and see if that works as expected or not..
      you can download any other excel file from the given link and can try..
      happy to help any further