BookmarkSubscribeRSS Feed
Rixile106
Fluorite | Level 6

Good day expects.

 

i nedd to replicate values from column A_EXP_DT to new_dt.

 

 

data VIEW;

set TEST;

if A_EXP_DT = '99999999' then new_dt = '99991231';


RUN;
Spoiler
Rixile106_0-1637062473789.png
Spoiler
Expected outcome:

Rixile106_1-1637062572540.png

 

 

 

 

 

5 REPLIES 5
EyalGonen
Lapis Lazuli | Level 10

I think this is what you want:

 

data VIEW;
set TEST;
new_dt = A_EXP_DT;
if A_EXP_DT = '99999999' then new_dt = '99991231';
RUN;
PeterClemmensen
Tourmaline | Level 20

How about

 

data VIEW;

   set TEST;

   new_dt = A_EXP_DT;
   if A_EXP_DT = '99999999' then new_dt = '99991231';

RUN;
Rixile106
Fluorite | Level 6

exactly what i want .thank you  a lot

Venky3110
Fluorite | Level 6
This may help
data VIEW; set TEST; A_EXP_DT =new_dt ; if A_EXP_DT = '99999999' then new_dt = '99991231'; RUN;

 

Peter_C
Rhodochrosite | Level 12
It is what COALESCE functions do.
As this column seems to hold what looks like a date but as a character string, the particular function might be
COALESCEC()

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
  • 5 replies
  • 1397 views
  • 0 likes
  • 5 in conversation