Here is some sample data:
data have;
infile datalines;
input ClaimNumber CLIENT $2. ID $2.;
datalines;
. TX B
1 B
2 B
3 C
. FL C
1 K
2 D
3 B
;;
run;And this is what I want to end up with:
data want;
infile datalines;
input ClaimNumber CLIENT $2. ID $2.;
datalines;
. TX B
1 TX B
2 TX B
3 TX C
. FL C
1 FL K
2 FL D
3 FL B
;;
run;The Client changes each time we hit a "." and the value of Client is there for that first line as you can see in the first sample, I just need to fill in the rest until we reach a new client and so on. Thanks.
data want;
set have;
retain newClient;
if not missing(Client) then newClient=Client;
run;
data want;
set have;
retain newClient;
if not missing(Client) then newClient=Client;
run;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
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 save with the early bird rate—just $795!
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.
Ready to level-up your skills? Choose your own adventure.