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()

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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