BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
data want;
set have;

retain newClient;

if not missing(Client) then newClient=Client;

run;

View solution in original post

2 REPLIES 2
Reeza
Super User
data want;
set have;

retain newClient;

if not missing(Client) then newClient=Client;

run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 5565 views
  • 1 like
  • 3 in conversation