BookmarkSubscribeRSS Feed
MagD
Quartz | Level 8

Hi All,

 

I hope this message finds you well. Please assist me with my below query.

 

I want to overwrite an existing table with updated information. I only want to overwrite a 1,000 accounts, and not the whole table of 20,000. I have the following:

 

Existing table:

accountactiondebtor
1paid upYou
2paid upYou
3paid upYou
4paid upYou
5paid upYou
6cureABA
7cureACA
8arrearsAKL

 

Desired output:

accountactiondebtor
1close' ''
2close' ''
3close' ''
4close' ''
5close' ''
6cureABA
7cureACA
8arrearsAKL
5 REPLIES 5
MagD
Quartz | Level 8
Hi KurtBremser,

I found a solution. It's not very efficient but it works. Thank you for wiling to help me.
sustagens
Pyrite | Level 9
Should the update be made whenever the value of action is "paid up"? or is it dependent on the account?
MagD
Quartz | Level 8
Hi sustagens

I found a solution, not very efficient though. I imported the accounts that needed to be changed then used the data step to update the variables.

data test;
set Hello;
if account in
(1
2
3
4) then action = ''close'';
run;

data Final;
set test;
if action = ''closed'' then debtor = " ";
run;
sustagens
Pyrite | Level 9
If it works then all good! It doesn't have to be complicated every time. All the best!

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 1053 views
  • 1 like
  • 3 in conversation