BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AncaTilea
Pyrite | Level 9

Hi.

what does the " =: " mean?

Thank you.

Anca.

muralip2013
Calcite | Level 5

Hi Antea,

Following is my data.

Data sample:

Set sample;

Amd1_9-;

AMD1_10-;

Run;

AMD1_9-History of another malignancy within the previous 5 years other than curatively treated non-

melanomatous skin cancer

AMD1_10-Current or prior treatment with estrogens and/or drugs with anti-androgenic properties such

as spironolactone > 50mg/kg, or progestational agents for the treatment of prostate cancer less than 6

months prior to randomization .

I need my new variable sample:

"History of another malignancy within the previous 5 years other than curatively treated non-

melanomatous skin cancer"

AncaTilea
Pyrite | Level 9

hmmm, something like this:

Data sample;

input sample $50.;

cards;

AMD1_9-History of another malignancy within

AMD1_10-Current or prior treatment with estrogens

;

Run;

proc print;run;

data want;

    set sample;

    new_sample = prxchange("s/.*[-]//i",1,(sample));

run;

proc print;run;

muralip2013
Calcite | Level 5

    new_sample = prxchange("s/.*[-]//i",1,(sample));

could u please tell me what i have to place in s and i

AncaTilea
Pyrite | Level 9

You don't need to change either of those s, or i (those are keywords for s = string, and i = case insensitive)

the variable name is sample, right?

OS2Rules
Obsidian | Level 7

The "=:' sets the length of the right side argument to the length of the left side argument.

So - if the left argument is 1 character, the "=:' will only look at the first character of the right side argument.

Very handy.

AncaTilea
Pyrite | Level 9

Thanks!

muralip2013
Calcite | Level 5

Thank you very much Tilea. Your suggestions were of great help.

regards,

Murali.

muralip2013
Calcite | Level 5

its  working but my last char in word is truncating

ex :fever

as feve  .

could u tell me any other way

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 23 replies
  • 1303 views
  • 9 likes
  • 5 in conversation