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

Hi Experts ,

I havea a data set that the values are showed like different raws and I want to make that raws in a single column .No problem if the claim and suffixs shows multiple times 

the data Have 

Claim Suffix  ICD10A  ICD10B  ICD10C ICD10D  ICD10E
12589 1         vvg         ijk           ghy        ilk            opl
12589 2          rty         ilk            rtr         erd           owe


data want

 Claim Suffix   ICD10
12589   1           vvg
12589   1           ijk
12589   1          ghy
12589   1         ilk
12589   1         opl
12589   2        rty
12589   2        ilk
12589  2        rtr
12589  2         erd
12589  2      owe

How to proceed with this scenario Please advice

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@jdwaterman91 minor suggestion:

Data Some2;
   Set Some;
   Array New A--E;
   Do _N_ = 1 to 5;
      ICD10 = New(_N_);
      if not missing(ICD10) then Output;
   End;
   Keep Claim Suffix ICD10;
Run;

@ambadi007 did not indicate whether or not the data may sometimes only have fewer than 5 codes, or possibly no codes at all, and what the output for those cases might be. I am assuming that a row with a missing ICD10 is pretty useless and excluding them.

 

View solution in original post

3 REPLIES 3
jdwaterman91
Obsidian | Level 7

Would something like this work for your situation?

 

data Some;
input Claim Suffix A $ B $ C $ D $ E $;
datalines;
12589 1 vvg ijk ghy ilk opl
12589 2 rty ilk rtr erd owe
;
run;

Data Some2;
Set Some;
Array New A--E;
Do _N_ = 1 to dim(New);
ICD10 = New(_N_);
Output;
End;
Keep Claim Suffix ICD10;
Run;

 

 

ballardw
Super User

@jdwaterman91 minor suggestion:

Data Some2;
   Set Some;
   Array New A--E;
   Do _N_ = 1 to 5;
      ICD10 = New(_N_);
      if not missing(ICD10) then Output;
   End;
   Keep Claim Suffix ICD10;
Run;

@ambadi007 did not indicate whether or not the data may sometimes only have fewer than 5 codes, or possibly no codes at all, and what the output for those cases might be. I am assuming that a row with a missing ICD10 is pretty useless and excluding them.

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 3 replies
  • 756 views
  • 1 like
  • 4 in conversation