BookmarkSubscribeRSS Feed
PilOSU
Obsidian | Level 7

 N/a

1 REPLY 1
ChrisNZ
Tourmaline | Level 20

Please use the appropriate icon when pasting code.

 

I don't understand what the question is, but your code would be better with something like:

 

proc format ;
value dx_code 
"001", "001.0", "001.1", "001.9",
"A00", "A00.0", "A00.1", "A00.9",
"002", "002.0", "002.1", "002.2", "002.3", "002.9", "A01", "A02",
"A01.0", "A01.1", "A01.2", "A01.3", "A01.4", "A01.00",
"003", "003.0", "003.1", "003.2", "003.8", "003.9",
"A02.0","A02.9",
"004", "004.0", "004.1", "004.2", "004.3", "004.8", "004.9",
"A03.0", "A03.3", "A03.8", "A03.9",
"005", "005.4", "005,8",
"A05.0", "A05.1", "A05.2", "A05.3", "A05.4", "A05.5", "A05.8","A05.9",
"006", "006.0", "006.1", "006.2", "006.3", "006.4", "006.5", "006.6", "006.7", "006.9",
"A06.0", "A06.1", "A06.2", "A06.9",
"007", "007.0", "007.1", "007.2", "007.3", "007.4", "007.5", "007.8", "007.9",
"A07.0", "A07.1", "A07.3", "A07.8", "A07.2", "A07.4", "A07.8", "A07.9",
"008.00", "008.0", "008.4", "008.09", "008.1", "008.2", "008.3", "008.4", "008.41",
"008.42", "008.43", "008.44", "008.45", "008.46", "008.47", "008.49", "008.5",
"008.6",
"A04.4", "A04.5", "A04.6", "A04.71","A04.72", "A04.8", "A04.9" = "X disease"

"008.8", "009", "558.9", "787.91", "A08.8", "A09",
"K52.89", "K52.9", "R19.7"                                     = "X Nonspecific disease"

"787.91", "R19.7"                                              = "Other symptoms involving disease: Symptom1" ;
run;

proc freq data = X.X;
  tables DX_CODE ;
  format DX_CODE dx_code.;
run;

Please tweak to suit your needs.

 

 

About the reporting question, please provide an example including:

- code to generate a data set (or use a table from the SASHELP library)

- desired output using that data

 

 

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 698 views
  • 2 likes
  • 2 in conversation