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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 23 replies
  • 3216 views
  • 9 likes
  • 5 in conversation