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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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