DATA Step, Macro, Functions and more

function ...contain()

Reply
Frequent Contributor
Posts: 97

function ...contain()


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

Super Contributor
Posts: 282

Re: function ...contain()

Posted in reply to allurai0412

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.

Frequent Contributor
Posts: 97

Re: function ...contain()

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....................

Respected Advisor
Posts: 4,173

Re: function ...contain()

Posted in reply to allurai0412

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.

Super Contributor
Posts: 282

Re: function ...contain()

Posted in reply to allurai0412

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.

Ask a Question
Discussion stats
  • 4 replies
  • 205 views
  • 0 likes
  • 3 in conversation