BookmarkSubscribeRSS Feed
allurai0412
Fluorite | Level 6


hi,

My frnd works SAS  and he said the function contain()..

data xxx.

input xxx;

datalines;

12

134

222

23

;

run;

data want;

set xxx;

where xxx  = cotain()........................................please let me know ,,, if this functions exists or not if it is ..please help me with PROPER syntax..

;

Regards,

Allu

4 REPLIES 4
Amir
PROC Star

Hi,

I can't find a contains function, but the contains operator does exist, and can be used as follows, for example:

data have;

  input text $;

  datalines;

abc

ab

abcd

abcde

;

run;

data want;

  set have;

  where text contains "cd";

run;

Regards,

Amir.

allurai0412
Fluorite | Level 6

thanks Amir....is there any chance that this is in new versions???? like 9.3 or 9.4??

   ................contain().........

example

data xxx;

input aaa;

12

2

131

22;

runl

where num  = contain(1)......./*Returns the   12 , 131 ....*/

or

where num = cotain(12).........../*Returns the 12

I am sorry for syntax errors...............but please check for functions ...??

        ......................will Any body in community help me....................

Patrick
Opal | Level 21

You simply use Google with a search string like "site:support.sas.com contains" and one of the first links will give you something like SAS(R) 9.2 Language Reference: Concepts, Second Edition

After that it's just RTM.

Amir
PROC Star

Hi,

I would echo what Patrick is saying and further recommend you familiarise yourself with navigating your way through the manual.

For 9.3 you can look at:

SAS(R) 9.3 Language Reference by Name, Product, and Category

and use the left hand pane to navigate to Functions -> General Functions -> Alphabetic Listing to see all of the functions available.

As far as 9.4 is concerned, perhaps try contacting SAS Technical Support.

Regards,

Amir.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2017 views
  • 0 likes
  • 3 in conversation