Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Moss cmd string search: case-sensitive

    For most applications, users want case-insensitive. I am looking for the opposite.

    If I use "moss" cmd:

    Code:
    moss v1, match("George") prefix(geo1)
    It returns a 1 if it finds "george" within the string variable (v1). I only want it to count an occurrence if it finds the exact (case-sensitive) string ("George").

    Or do I need to use nss cmd within egenmore. Or is there a better command then nss?

    Thanks in advance.

  • #2
    moss (from SSC) is not a function, it is a command and it does not return a 1, it generates variables. It is also case-sensitive:

    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . moss make, match("concord") prefix(geol)
    
    . list make geol* in 1
    
         +------------------------+
         | make          geolco~t |
         |------------------------|
      1. | AMC Concord          0 |
         +------------------------+
    
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . moss make, match("Concord") prefix(geol)
    
    . list make geol* in 1
    
         +-----------------------------------+
         | make          geolco~t   geolpos1 |
         |-----------------------------------|
      1. | AMC Concord          1          5 |
         +-----------------------------------+

    Comment


    • #3
      Robert,

      My mistake. Thanks for the clarification. I have too many string variables in my data and I looked at the variable name wrong. Sorry to cost you time.

      --Kyle

      Comment

      Working...
      X